Forum Discussion
SQL Query with Actual Date
- Anonymous7 years ago
SELECT * FROM mmstatistik WHERE belegdatum BETWEEN {d '01/01/2018'} AND Date()was rellay simple...and a lucky type...
that works and gives me the actual date
Thanks for alle the help and sorry for the circumstances.
I got a parsing error with WHERE clause? What that did I typed wrong?
Or is that Convert Statement not useful for the Source Code?
I miss a quote in the first select {d, '...'}
- Anonymous7 years agoNot applicable
Now I get a semicolin Expecting error...what a mess did I do :)? Where should the semicolon placed?
SELECT * FROM mmstatistik WHERE belegdatum {d '01/01/2018'} AND belegdatum <= Convert(date,getdate())EDIT: I saw it the >= was missing :)
- Anonymous7 years agoNot applicable
Still not working but I did a Test like this
SELECT * FROM mmstatistik WHERE belegdatum BETWEEN {d '01/01/2018'} AND {d '01/31/2018'}and that worked...but this doesn't
SELECT * FROM mmstatistik WHERE belegdatum BETWEEN {d '01/01/2018'} AND Convert(Date,GetDate())I am just guessing because I place {d ' 09/21/2018'} aswell...what output should Convert(Date,GetDate()) give me? I saw something like this 21.09.2018 in further tests. Can i change the Format in the SQL Statement? I guess it's a local date option or something like that :).
EDIT: But i the data colum it's place like 21.09.2018 aswell. And the right Culture Option is selected.
- richardverburg7 years agoHelper I
What data type has the column belegdatum?