SQL CE 3.5 -- This query returns a list of account numbers plus columns for current and late amounts, a simple A/R aging.
The query works, but the aging is done based on GETDATE(), and I need to change that to a user-supplied value, so the aging can be done a few days before or a few days after. So I replaced GETDATE() with @agingdate. Now, if I use the SQL window in the database explorer or the SQL builder in the dataset designer, I get the prompt to enter the parameter, and then I get the error message: "The parameter is incorrect." I'm entering the date correctly, so what can be the problem?
If this is a CE 3.5 limitation, can you suggest a workaround?
Thanks!
VB.NET:
SELECT accountnum,
SUM(CASE WHEN DATEDIFF(d, GETDATE(), billeddate) < 31 THEN amount ELSE 0 END) AS curbal,
SUM(CASE WHEN DATEDIFF(d, GETDATE(), billeddate) >= 31 THEN amount ELSE 0 END) AS latebal
FROM billingtrans
GROUP BY accountnum
The query works, but the aging is done based on GETDATE(), and I need to change that to a user-supplied value, so the aging can be done a few days before or a few days after. So I replaced GETDATE() with @agingdate. Now, if I use the SQL window in the database explorer or the SQL builder in the dataset designer, I get the prompt to enter the parameter, and then I get the error message: "The parameter is incorrect." I'm entering the date correctly, so what can be the problem?
If this is a CE 3.5 limitation, can you suggest a workaround?
Thanks!