Skip to Content

Arithmetic overflow error converting expression to data type datetime

Dear Experts,

I try to generate one SAP query to find out the transfer quantity of stock (open balance & closing balance of stock). It got error when I try to execute it. Below is the query:

SELECT T0.[DocDate], T0.[InQty], T0.[OutQty], T0.[CalcPrice], T0.[TransType], T0.[Warehouse], T0.[JrnlMemo], T0.[BASE_REF], T0.[RevalTotal], T0.[Price], T0.[TransValue], T1.[ItemCode], T1.[ItemName],T2.[CardName], T3.[ItmsGrpNam] FROM OINM T0  INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode INNER JOIN OITB T3 ON T1.ItmsGrpCod = T3.ItmsGrpCod INNER JOIN ODLN T2 ON T0.BASE_REF=T2.DocNum AND T0.TransType=T2.ObjType WHERE T3.[ItmsGrpNam] = 'Finished Goods' AND T0.[Warehouse] = 'FG01' AND (T0.[DocDate] >=[%0] AND T0.[DocDate] <=[%1]) AND (T0.[InQty]<>0 OR  T0.[OutQty] <>0 OR  T0.[Price]<>0) ORDER BY T0.Warehouse, T3.ItmsGrpNam, T1.ItemCode

I get the "Arithmetic overflow error converting expression to data type datetime" error message.

Anyone here can tell me what is it about?

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 20, 2010 at 02:10 PM

    Hi,

    Try change to:

    T0.[DocDate] Beteen [%0] AND [%1]
    

    or

    T0.[DocDate] Beteen '[%0]' AND '[%1]'
    

    Have you got the date selection screen open before error message?

    Thanks,

    Gordon

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 20, 2010 at 11:15 AM

    Hi..

    In your query where is the formula for opening balance??

    Regards,

    Bhavank

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 20, 2010 at 04:10 PM

    I have tried that no problem with your query. Have you tested by my way?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 21, 2010 at 05:59 PM

    Please close your thread by mark it is answered since your problem solved.

    Add comment
    10|10000 characters needed characters exceeded