SQL Date Question

Results 1 to 2 of 2

Thread: SQL Date Question

  1. #1
    Join Date
    Dec 1969

    Default SQL Date Question

    I have the following sql statement: (Using Access)<BR><BR>Select Sum(Sales.SaleTotalPrice) AS Total, Sum(Sales.SaleSubTotalPrice) AS SubTotal, Sum(Sales.SaleTotalTax) AS Tax<BR>From Sales Where Sales.SaleDate = #3/11/2003#<BR><BR><BR>The field Sales.SaleDate is a date time field (3/11/2003 2:09:55 PM)<BR><BR>Its not returning any records..... How can I Format the field to remove the time?

  2. #2
    Join Date
    Dec 1969

    Default Assuming this is Access...

    ... FROM Sales WHERE DateValue( SaleDate ) = #3/11/2003#<BR><BR>DateValue() works exactly the same in Access as it does in VBScript, so you can look it up in the VBS docs.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts