I’m trying to sort customers billings and i need to sort them by different time periods.
What I’ve been trying is:
(select billing_date from [transaktions]
between '" + start + "' and '" +stop+"' where konto_nr = @konto_nr")
also
(select billing_date from [transaktions] where konto_nr = @konto_nr" between '" + start + "' and '" +stop+"')
start = the starting period of the date
stop = the ending of the period
The error message I’m getting is
Incorrect syntax near the keyword
‘between’.
Your syntax should be something like
of the obvious respective columns and variable names you are working with. Yes, you referred to the “billing_date” as a selected column, but the WHERE can be testing OTHER columns of criteria so you have to explicitly identify it there too.