Link to home
Start Free TrialLog in
Avatar of Moe DeShong
Moe DeShongFlag for United States of America

asked on

Sql date value

How do I change this sql statement to retrieve yesterday's records instead of todays.

 fSql = "SELECT COUNT(*) FROM Transactions WHERE Transactions.Code = 'EF' AND " _
            & "Transactions.Last_Mdt >= convert(datetime, convert(varchar(10), getdate(), 120), 120) " _
            & "AND Transactions.Last_Mdt < dateadd(day, 1,convert(datetime, convert(varchar(10), getdate(), 120), 120))  " _
            & " AND left(Transactions.ticket_no,1)= " & dt.Rows(i).Item(0) & ""
ASKER CERTIFIED SOLUTION
Avatar of Joel Coehoorn
Joel Coehoorn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Moe DeShong

ASKER

Hey, Thanks a million.