Greetings,
I have created a front-end access form that pulls data from SQL Server. The form is working OK and users can add, modify, and delete data. However, one field on the SQL Server end should be calculated as a date. It is currently in the format of MMDDYY. I am trying to create a textbox calculation that subtracts the current date from the SQL Server date being pulled into the form. It does not work and returns an error in the textbox: "#NAME". I have tried everything from making sure proper references are checked to changing the format of the date. Nothing seems to work. I have ever tried performing a similar calculation on a stand-alone form and it works just fine. It is only when pulling SQL Server data that it does not work?? I think the problem may be the fact that DATE() returns the date in MM/DD/YY format, and the SQL Server field is in MMDDYY format (as text). I am not allowed to go into the SQL Server side and change this field to a date field; but I have tried to change the format on the Access side. Is there anything that can be done?? I am currently using the calculation of =(Date()-[SDate]) in the textbox and it just renders an error #NAME. However, the same formula works on the form if no SQL Server data is introduced. I am thinking of a way to force the format of the SQL Server date from text of MMDDYY to a date format of MM/DD/YY. But I tried everything and nothing will format the field to the date format (I can only format the field from the Access side). Thank you for helping me!!!
JM
I have created a front-end access form that pulls data from SQL Server. The form is working OK and users can add, modify, and delete data. However, one field on the SQL Server end should be calculated as a date. It is currently in the format of MMDDYY. I am trying to create a textbox calculation that subtracts the current date from the SQL Server date being pulled into the form. It does not work and returns an error in the textbox: "#NAME". I have tried everything from making sure proper references are checked to changing the format of the date. Nothing seems to work. I have ever tried performing a similar calculation on a stand-alone form and it works just fine. It is only when pulling SQL Server data that it does not work?? I think the problem may be the fact that DATE() returns the date in MM/DD/YY format, and the SQL Server field is in MMDDYY format (as text). I am not allowed to go into the SQL Server side and change this field to a date field; but I have tried to change the format on the Access side. Is there anything that can be done?? I am currently using the calculation of =(Date()-[SDate]) in the textbox and it just renders an error #NAME. However, the same formula works on the form if no SQL Server data is introduced. I am thinking of a way to force the format of the SQL Server date from text of MMDDYY to a date format of MM/DD/YY. But I tried everything and nothing will format the field to the date format (I can only format the field from the Access side). Thank you for helping me!!!
JM