Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 15th, 2005, 09:32 PM
didi7 didi7 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 1 didi7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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?

Reply With Quote
  #2  
Old June 17th, 2005, 11:29 AM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 4
Not sure, but try using the .Value instead of the .Text in your strSql. I am not very familiar with ASP.net so if that doesn't help maybe someone can post a solution.

lwells

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Access Querying problems with dates.. Gurus pls help..


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway