469,125 Members | 1,607 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,125 developers. It's quick & easy.

dates problem

121 100+
Hi all
i have access databae in which a table consists of all staff details with dat now if want to retrieve records between 5/01/2008 to 10/01/2008.i dot know the syntax of using between query can u pls help
Jan 12 '08 #1
5 976
QVeen72
1,445 Expert 1GB
Hi all
i have access databae in which a table consists of all staff details with dat now if want to retrieve records between 5/01/2008 to 10/01/2008.i dot know the syntax of using between query can u pls help
Hi,

Check this :

SELECT * From MyTable Where MYDate Between #05-01-2008#
And #10-01-2008#

Regards
Veena
Jan 12 '08 #2
charvi
121 100+
rs.Open "select * from timesheet where date between #" & mskfrom & "#" And "# & mskTo & #", con, adOpenDynamic, adLockOptimistic

I have written this ode but it giv me runtime error.
pls help
Jan 13 '08 #3
charvi
121 100+
rs.Open "select * from timesheet where date between #" & mskfrom & "#" And "# & mskTo & #", con, adOpenDynamic, adLockOptimistic

I have written this ode but it giv me runtime error.
pls help
when writethis code it gives all the records..e if i want to search between 2/01 and 5/01 igives me al recordsof 6/1 ,7/01 so on
Jan 13 '08 #4
charvi
121 100+
when writethis code it gives all the records..e if i want to search between 2/01 and 5/01 igives me al recordsof 6/1 ,7/01 so on
i getthis dateproble when i enter in the form of mm/dd/yyyy in mskedbox1 though i have formatted maskedbox as dd/mm/yyyy why is it pls help
Jan 13 '08 #5
Killer42
8,435 Expert 8TB
i getthis dateproble when i enter in the form of mm/dd/yyyy in mskedbox1 though i have formatted maskedbox as dd/mm/yyyy why is it pls help
You need to show us the exact string which is being passed to Access. The fact that the masked edit control shows something in a particular format on the form doesn't tell us anything about what you're getting out of it.

Pretty sure Access demands U.S. date format (MM/DD/YYYY) so the syntax should be something like...

SELECT * From MyTable Where MyDate Between #01/05/2008# And #01/10/2008#

Alternatively, you might avoid the date format issue by using an unambifuous format. That is, one in which the month and day cannot be confused. For example...

SELECT * From MyTable Where MyDate Between #05-Jan-2008# And #10-Jan-2008#
Jan 13 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by PW | last post: by
7 posts views Thread by Bambero | last post: by
7 posts views Thread by smcgouga | last post: by
1 post views Thread by Likhith Areekkal | last post: by
2 posts views Thread by Jim Carlock | last post: by
5 posts views Thread by jorgedelgadolopez | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.