Jump to content

Query to select single date from datetime field


bryan11

Recommended Posts

I've been searching records using ranges of dates with this kind of select statement:

select * from Orders where Orders.BillName="Village Pantry" and Orders.ShipDate >= '2006-07-25';

Orders.ShipDate is a datetime field. Now I need to select rows from an exact date, but this doesn't yield any results though many rows exist with this date:

select * from Orders where Orders.BillName="Fred's" and Orders.ShipDate = '2006-07-25';

I tried several variations on this and the results got weird. For example, using the following query I get dates from 7/24/06 to 7/25/06:

select * from Orders where Orders.BillName="Fred's" and Orders.ShipDate < '2006-07-26' and Orders.ShipDate > '2006-07-24' and Orders.QuickBooks != '' order by Orders.ShipDate;

How may I select records only for '2006-07-25' ?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.