Skip to Content
0
Sep 09, 2022 at 04:50 AM

Error creating the time range query in SAP B1 V10

152 Views Last edit Dec 11, 2022 at 06:23 AM 2 rev

Hi all,

I am trying to create a general time range query for the management which will allow them to select the dates and see the invoices for that specific date range.

The query I generate using the query wizard is this:

SELECT T0."CreateDate" AS "Creation Date", T0."DocDate" AS "Posting Date", T0."DocNum" AS "Document Number", T0."CardCode" AS "Customer/Vendor Code", T0."CardName" AS "Customer/Vendor Name" FROM "DB-123-LIVE"."OINV" T0 WHERE T0."DocDate" > (TO_TIMESTAMP('[%0]', 'YYYYMMDD') ) AND T0."DocDate" < (TO_TIMESTAMP('[%1]', 'YYYYMMDD') )

image.png

I do get the date range selection range tab as shown above but when I try to put the date the error I receive is as following:

1). [SAP AG][LIBODBCHDB DLL][HDBODBC] General error;303 invalid DATE, TIME or TIMESTAMP value: Error while parsing '2022-08-20 00:00:00.0000000' in format 'YYYYMMDD' as DATE/TIME at "to_timestamp" function 'Received Alerts' (OAIB) (at pos 245)

Is there something I am doing wrong? Would appreciate your suggestions.

Thank you advance.

Attachments

image.png (6.6 kB)