Displaying Query Results Incorrectly

Sean25

Registered User.
Local time
Yesterday, 22:23
Joined
Feb 16, 2004
Messages
25
I'm sure this is another simple "D'oh!" that I'm just not seeing, but here's the problem...

I query a boolean field, if it's true, 640 gets added to the date in a date field (two years), if it's false, 365 gets added (one year). Query works, no problem.

The problem is that the Field on the Form that is displaying the new date does nto display it in the correct format. The 'Input Mask' and 'Format' Propertied fields are set up identically as the Field on the Form that displays the original date, which views correctly. The funny thing is, the Field IS displaying a date result, just not in the format it's supposed to.

What am I missing either in the IIF statement that is causing the query result to not return to a format that the field is handling correctly, and/or what can I do on the form to force the field to display the date the way I want it to?
 
I query a boolean field, if it's true, 640 gets added to the date in a date field (two years), if it's false, 365 gets added (one year). Query works, no problem.
You might want to consider using the DateAdd function to add one year or two. Years are not always 365 days.

What is the date field displaying? And how do you want it to look? What display format have you chosen?
 
dcx693 said:
You might want to consider using the DateAdd function to add one year or two. Years are not always 365 days.

What is the date field displaying? And how do you want it to look? What display format have you chosen?

The date field is displaying dd/mm/yy, but I have chosen the Medium Date format which should be dd-MMM-yy (Month in text, not numbers). Again the Date from the Table is displayin correctily in the Field right next to the 'query' field, set up identically, and it is displaying the date correctly.

IE:

I want it to show:

Start Date 02-Mar-03 End Date 02-Mar-04

But it's actually showing:

Start Date 02-Mar-03 End Date 02/03/04


S.
 
Last edited:
Sean25 said:
I query a boolean field, if it's true, 640 gets added to the date in a date field (two years), if it's false, 365 gets added (one year). Query works, no problem

I think you are actually one day out. As dcx says, add 1 or 2 years, not days.
 
Mile-O-Phile said:
I think you are actually one day out. As dcx says, add 1 or 2 years, not days.


Okay, I changed it to use the DateAdd function, but that still did not correct the problem I'm having. (well, so it corrected a minor oversight in leap year technology, BUT) the field is still displaying the date in all numerics.

S.
 
I don't really have any good ideas. If one field is displaying properly but the other isn't, my first inclination would be to see what's different about them. I would think that setting the field display format on the form would control the display, but perhaps not. Check the query field format as well and see what you turn up.
 
dcx693 said:
I don't really have any good ideas. If one field is displaying properly but the other isn't, my first inclination would be to see what's different about them. I would think that setting the field display format on the form would control the display, but perhaps not. Check the query field format as well and see what you turn up.


It's really odd. Everything indicates (ALL format settings for anything that touches the field, on the form and in the query) that it should be the Medium Date Format, but it's still displaying as Short Date. The only difference between the fields is that one is actually a field in the Table, and the one that isn't displaying properly is a Query result.

S.
 

Users who are viewing this thread

Back
Top Bottom