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

Date difference

P: 1
Hello All,

In database i am storing value in "2007-03-22 02:00:00-05" formate

And from input i am taking start date in "2007-3-25" formate and end date in "2007-5-20" formate .

Now what i want is i want to fetch all the records from the table which comes between this start and end date. Can anyone help me with this.

Thank you
May 16 '07 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 534
Did you try
Expand|Select|Wrap|Line Numbers
  1. select * from myTable where dateField between fromDate and toDate;
If you need a more sophisticated logic (account for GMT offset, etc) you may need to plug-in one of the Date/Time functions
May 17 '07 #2

Post your reply

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