
June 15th, 2005, 09:32 PM
|
|
Registered User
|
|
Join Date: Jun 2005
Posts: 1
Time spent in forums: 24 m 58 sec
Reputation Power: 0
|
|
|
Access Querying problems with dates.. Gurus pls help..
Hi there, I'm a newbie here and hereby give my regards to all the gurus out there.
I currently have this strange strange problem with querying access date fields using asp.net.
Firstly, this is my SQL query in ASP.net using Vb.NET
strSQL = "SELECT * FROM GiftForm WHERE [SubmittedDate]>= "
strSQL = strSQL & "#" & txtfromDate.Text & "#"
strSQL = strSQL & " AND [SubmittedDate] <= "
strSQL = strSQL & "#" & txtToDate.Text & "#"
as you can see I'm querying my database to search a range of dates as input by my users and return the results. My access database is using the Date datatype and is US format. The problem i'm encontering is that when i do a valid query is gives me the results i wanted which is correct. Then I entered a range of dates which i noe is invalid and it indeed could not find the records which is correct. Then I input the correct dates again and it should give me the results but it didn't. So in short, my problem is that, my results based on the query is not consistent which makes my debugging very hard.
I have tried using the BETWEEN..AND statement but it also gives the same problem. Any help?
|