Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date different in reports for different users 2

Status
Not open for further replies.

HJessen

Technical User
Dec 18, 2002
39
US
I hope this is the place for this question.

We have a report that is supposed to print out individuals who have birthdays for the month selected in a form. When I run the request - it works. When others run the request - they get 'data type mismatch'. Here is the basic info:

TABLE-1
Field Name: Date_Of_Birth
Field Type: Date/Time
Format: DD-MMM-YYYY

QUERY-1
Field Name: Date_Of_Birth
Field Name: BM:=Mid([date_of_birth],1,2)
Field Name: BD: Mid([date_of_birth],4,2)
BM is supposed to be the birth month and is sorted ascended
BD is supposed to be the birth day and is sorted ascended

Each of these new fields return a two digit number to me, but to others they get a month that is '7/' instead of '07' that I get. Additionally, how can the BM (birth month) be the first two positions of date_of_birth, and the BD (birth day) be the middle four, if I have formatted the data as dd-mmm-yyyy. The date in the table shows up as 27-Jan-2003. I am confused right now.

Thanks. H. Jessen
"Now I know more, and I feel dummer"
 
Hi

Try

QUERY-1
Field Name: Date_Of_Birth
Field Name: BM:=Mid(Format([date_of_birth],"mm/dd/yy"),1,2)
Field Name: BD: Mid(Format([date_of_birth],"mm/dd/yy"),4,2)
Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hi

Sorry to expand on that, by not specify a format for the date, you are relying on the default, which is a windows setting, on users PC, over which you have not control, hence sometimes it is OK, sometimes it is not, by using Format you are taking control and forcing the format to be as you want it.

Hope this helps Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 

TO: KenReay

THANK YOU!

Couldn't figure out what or why, but I had more or less determined that it had to be individual settings somewhere.

That worked for me. I never used the format function before, but I will remember it now!

Again, THANKS. H. Jessen
"Now I know more, and I feel dummer"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top