By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,282 Members | 1,648 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,282 IT Pros & Developers. It's quick & easy.

Filtering a record using Dates

manoj9849967222
P: 48
Hi All

I have a great problem. Is there a way to filter records using dates.
I have a table called sales. now i want to filter record say from 1/1/2006 to 1/1/2007. which would show me the sales between this period.

Please help


Regards
Manoj
Sep 8 '07 #1
Share this Question
Share on Google+
3 Replies


FishVal
Expert 2.5K+
P: 2,653
Hi All

I have a great problem. Is there a way to filter records using dates.
I have a table called sales. now i want to filter record say from 1/1/2006 to 1/1/2007. which would show me the sales between this period.

Please help


Regards
Manoj
Hi, Manoj.

You can easily filter records by date.
Keep in mind SQL syntax. It accepts dates in m/d/y format enclosed in "#".
2-Jan-2007 = #1/2/2007#
Sep 8 '07 #2

manoj9849967222
P: 48
Hi FishVal

I am not so good at SQL. could you please help me in writing SQL statement to filter the data between two given dates.

regards
Manoj
Sep 8 '07 #3

FishVal
Expert 2.5K+
P: 2,653
Hi FishVal

I am not so good at SQL. could you please help me in writing SQL statement to filter the data between two given dates.

regards
Manoj
Hi, Manoj.

Use query builder to create a query you need, then see SQL text of the query.
Something like this.

Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM [sales] WHERE [sales].[SaleDate] >= #1/1/2006# AND [sales].[SaleDate] < #1/1/2007#;
  2.  
Sep 9 '07 #4

Post your reply

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