September 6, 2012 at 2:55 am
I am designing a reporting in Business Intelligence design studio. In query designer i have a
a query as:
SELECT UserId, Class, SumInvoiceValue, SumCostPrice, Margin, Invoice_Date
FROM View_telesales
WHERE (Invoice_Date BETWEEN '@StartDate' AND '@EndDate')
In my report i also have two paramters: @StartDate and @EndDate
When i attempt to run the report i am getting the error message:
Conversion failed when convertig date and/or time from character string.
The date Invoice_Date field in SQL server is a date datatype. Please could you help
September 6, 2012 at 4:55 am
WHERE (Invoice_Date BETWEEN '@StartDate' AND '@EndDate')
remove the single quotes - you have turned your variables in to strings
'@StartDate' should be @StartDate
MVDBA
September 6, 2012 at 6:17 am
The quotes have been removed. I have checked and ran the report again. I am still getting the same message:
Conversion failed when converting date and/or time from character string.
September 6, 2012 at 7:58 am
a couple of options then
.. is the field in the database a date or datetime field?
.. is your report passing dates in the wrong format ... easy to test - set the dates to values before the 13th day of the month (eg 12/01/2012) , if it works and when you try and pass in 13/01/2012 then you know it's the date format or connection setting
MVDBA
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply