Date Format

mouisset1
NewLounger
Posts: 20
Joined: 26 Jul 2011, 14:08

Date Format

Post by mouisset1 »

I have a shared database to track current employees, which uses multiple date fields formated as short dates, 04-Jul-14 . On my computer I created a query to search specifice date fields using the 'Jul' parameter. It works just fine on my computer and shows the records I am looking for. However on another persons computer, the query comes up null because it shows all the dates 04-07-14. How do I correct this so anyone with access to the database can pull of the established queries?

User avatar
HansV
Administrator
Posts: 78443
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Date Format

Post by HansV »

In the query, create calculated columns like this:

Month1: Month([DateField1])

Clear the Show check box for these columns, and enter the month number to filter on in the Criteria row. For example, for July, enter 7.
Best wishes,
Hans

mouisset1
NewLounger
Posts: 20
Joined: 26 Jul 2011, 14:08

Re: Date Format

Post by mouisset1 »

I tried that but then the reverse happens and nothing will show on the computer(s) that show the date as 04-Jul-14. I've tried setting the field as a date/time and selecting the short date format, but it still shows differently on the different computers that are acessing the file.

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Date Format

Post by Rudi »

Are you sure the field (in the source table) is a date/time type? It sound more like it is stored as a string, else Hans's criteria would work.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78443
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Date Format

Post by HansV »

But if the dates are stored as strings, they wouldn't be displayed as 04-Jul-14 on mouisset1's computer and as 04-07-14 on someone else's PC...
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Date Format

Post by Rudi »

HansV wrote:But if the dates are stored as strings, they wouldn't be displayed as 04-Jul-14 on mouisset1's computer and as 04-07-14 on someone else's PC...
True...
doh.gif
[/size]
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

mouisset1
NewLounger
Posts: 20
Joined: 26 Jul 2011, 14:08

Re: Date Format

Post by mouisset1 »

my brain finally kicked in -- I changed the field to 'text' and then set the format to short date and it works on the different computers. THANK YOU!!!!

User avatar
HansV
Administrator
Posts: 78443
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Date Format

Post by HansV »

I'm not sure that's a good idea - it will be more difficult to perform date calculations. But if it works for you - fine!
Best wishes,
Hans