Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 29th, 2004, 05:14 AM
Registered User
 
Join Date: Mar 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default prob with comparing date in access

hi,
i have access database storing date values as datatype string
no i want record of dates between 2 dates
i mean
select * from table where (adate) between '20/03/2004' and '02/04/2004'

some times this workds but it compares only first 2 characters above result gives record with date more than 20.

i tried saving data in dat/time format and then executed query but gives no result.

i also tried with
select 8 from table where adate>'20/03/2004' and adate<'02/04/2004'

thanx in advance for help
nilesh
Reply With Quote
  #2 (permalink)  
Old March 29th, 2004, 10:59 AM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Keep date as date in a field. Why keep dates as strings? A string will be used as a string by any program.

Now, if you keep it as date,
Between #3/4/2004# And #3/5/2004#

your single quotes tell access "treat this as a string".

I notice that you have some type of European date format. Use the Access query builder to write your query. your sintax is wrong. ine would look like this:

SELECT Table1.date1
FROM Table1
WHERE (((Table1.date1) Between #3/4/2004# And #3/5/2004#));







Sal
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
comparing date column with sql server mallikalapati ASP.NET 2.0 Professional 3 March 12th, 2008 06:06 PM
Trouble with comparing date fields JimmyNeutron Access VBA 3 February 22nd, 2005 09:14 AM
dispaly date prob... help... abhit_kumar JSP Basics 1 January 7th, 2005 12:55 PM
dispaly date prob... help... abhit_kumar MySQL 1 December 14th, 2004 04:32 AM
dispaly date prob... help... abhit_kumar JSP Basics 0 December 3rd, 2004 08:00 AM



All times are GMT -4. The time now is 11:21 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.