on 01-23-2020 4:21 PM
Hello Friends,
I am trying below command and its not giving any output.
select count (*) from sapsr3.VBHDR where vbdate = TO_CHAR( CURRENT_DATE,'FXYYYYMMDDHHMISS');
Any help would be appriciated.
Regards,
Gurprinder
Hi Kashyap,
Fixed myself. below is the answer. I am using oracle. below query will give you total no of failed updated in SAP (sm13) for current date when you run the query
select count(*) from sapsr3.vbhdr where vbrc >= 2 and vbrc <= 201 and vbdate >= TO_CHAR ( Current_date, 'FXYYYYMMDD HH24MISS');
Regards,
Gurprinder
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kashyap,
i am trying in oracle. below is output.
SQL> select count(*) from sapsr3.VBHDR where VBDATE like CONCAT(CAST(CURRENT_DATE AS VARCHAR),'%'); select count(*) from sapsr3.VBHDR where VBDATE like CONCAT(CAST(CURRENT_DATE AS VARCHAR),'%') * ERROR at line 1: ORA-00906: missing left parenthesis
vbdate field format is below.
vbdate
-----------------------
20200105155037
Regards,
Gurprinder
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gurprinder,
I've not got any entries in VBHDR on HANA systems but MS SQL Server where I've tried the query.
select count(*) from <shema>.VBHDR where VBDATE like CONCAT(CONVERT(VARCHAR(20), getdate(), 112),'%')
Above works on MS SQL Server database.
Following query, I think should work on HANA (it does syntactally) but I don't have anyway to verify that it works logically:
select count(*) from <schema>.VBHDR where VBDATE like CONCAT(CAST(CURRENT_DATE AS VARCHAR),'%')
Best Regards,
Kashyap Shah
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kashyap,
Yes, without where condition it give me total no of updates in system but i want total no of updates for current date. Without where condition i am getting output. issue is with date formatt.
select count (*) from sapsr3.VBHDR where vbdate = TO_CHAR( CURRENT_DATE,'FXYYYYMMDDHHMISS');
Regards,
Gurprinder
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gurprinder,
I guess you mean it returns 0 row. Did you consider that there could actually be no entry with that WHERE condition.
For fun, just try without any condition to make sure table contain something at least.
Best Regards,
Kashyap Shah
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.