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' ?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.