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!

Dates and access?

Status
Not open for further replies.

Cheech

Technical User
Nov 6, 2000
2,933
EU
I am using an asp page to pull info from an access.mdb

I have a field called book_date with the format set to Shortdate. If I look directly at the data in the db it is in the format dd/mm/yyyy.
I then try to pull records by comparing it to a passed date in dd/mm/yyyy format.

If I use asp to pull a record the date is returned as dd/mm/yy.

Any clues

Cheech

[Peace][Pipe]
If you don't stand up for something, you'll fall down. Toke it Easy.
Howard Marks.
 
so whats the problem?

the data is inserted in the format u want(here i doubt it as access uses mm/dd/yyyy format) and is also returned in the same format...

Known is handfull, Unknown is worldfull
 
My problem is that no records seem to be returned.

The database date field is set as Shortdate and the data is in a dd/mm/yyyy format.

When I pull the data out via an asp page it is returned as dd/mm/yy

Cheech

[Peace][Pipe]
If you don't stand up for something, you'll fall down. Toke it Easy.
Howard Marks.
 
problems with date showing yy instead of yyyy might be for one of the following reasons:

1. Your ODBC drivers are too old and they don't have the Y2K updates (if u r using Windows 2000, install service pack 3 or 4 "I didn't test 4 yet")..

2. Might be due to your computer's regional settings, check the date settings in your regional settings.

Hope this will help....
 
>>When I pull the data out via an asp page it is returned as dd/mm/yy

>>My problem is that no records seem to be returned.

i am confused....

Known is handfull, Unknown is worldfull
 
I guess you are confusing everyone here.... You say that you are getting the Data in a specific format, than you say that you are getting blank when trying to pull data ??

When you say through ASP, you mean to pull current date from the machine ?? WHich is not working pulling date from database, or getting the date from the machine, because both of them are "via an ASP Page !!
 
The problem has solved itself by deleting all records from the database and starting again.

But to explain myself clearly.

I have an access database with a field called book_date. This field is set as "Short Date" (dd/mm/yyyy). If I look into the database the data is in that format.

My asp page uses
"SELECT * FROM tblBookings WHERE room_id = '1' AND book_date = #" & strDate & "#"

strDate is set earlier in the page in dd/mm/yyyy format.

No records were being pulled by this sql, even though I know there were matching dates in the database.

As a trouble shooting task I used this

"SELECT * FROM tblBookings"

and used a repeat region to display all of the book_date field's, all entries were showing on the page as dd/mm/yy format.

Cheech


[Peace][Pipe]
If you don't stand up for something, you'll fall down. Toke it Easy.
Howard Marks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top