cancel
Showing results for 
Search instead for 
Did you mean: 

error [conversion failed when converting date and/or time from character string]

0 Kudos
487

Greetings,

I have some difficulties when placing my query on UDV, below is my query to get price list based on document date in the active Sales Order

SELECT Price FROM ITM1 T0

INNER JOIN OPLN T1 ON T1.[ListNum] = T0.[PriceList]

WHERE ItemCode = $[RDR1.ItemCode]

AND Year($[ORDR.DocDate]) = Year (T1.[ValidFrom])

the date display in general settings - tab displays is DD/MM/YY

I recognize it has no problems from 1st Jan 2021 to 12th Jan 2021 when 13th Jan 2021 it shows error like this : [conversion failed when converting date and/or time from character string], so I checked my query using user queries and shows like this

SELECT Price FROM ITM1 T0

INNER JOIN OPLN T1 ON T1.[ListNum] = T0.[PriceList]

WHERE ItemCode = N'00017-25MG '

AND Year(N'13.01.21')= Year (T1.[ValidFrom])

if I change general setting - tab displays date format to MM/DD/YY my query has no problems, but my clients would not like that option

please help me with this query

Thank you very much

Accepted Solutions (0)

Answers (0)