First off, if I've picked the wrong forum please advise - I wasn't sure which SQL forum would be best as I have no idea which SQL Crystal uses.
Now, I have a date field in my database (ODBC) stored as text "YYYYMMDD". I want to create a command in Crystal select records in SQL where the string represents yesterday. I though I had it with
but apparently SQL doesn't like me trying to use the constant TODAY in a function.
Can you advise on how best to change my WHERE line to get the selection I want?
C
Now, I have a date field in my database (ODBC) stored as text "YYYYMMDD". I want to create a command in Crystal select records in SQL where the string represents yesterday. I though I had it with
Code:
WHERE "Data"."Date_Field"=STR(DATEADD(dd,-1,TODAY),'yyyymmdd')
Can you advise on how best to change my WHERE line to get the selection I want?
C