/*This SQL script uses the Demo database.
  This sample illustrates use of the CAST function.
  The query retrieves all records from the Sales
  Table where the Date portion of the LastInvoiceDate
  field (which is a TimeStamp field) is greater than
  Nov 6th, 1994.  If you don't use the CAST function
  here, the query would also take into account the
  time portion of the field and return records that
  were invoiced after 12:00 AM on the 6th of Nov.
  but were still on the 6th!*/



SELECT 
  sales.Company,
  sales.Addr1,
  sales.Addr2,
  sales.City,
  sales.State,
  sales.LastInvoiceDate,
  sales.Zip
FROM
 sales
WHERE
 CAST (sales.LastInvoiceDate AS DATE)  > '1994-11-06'
ORDER BY
  sales.Company ASC