Jbancr1
asked on
How to have report pull data for current date
How do you set a report to pull data from current date (today) with out entering todays date?
SELECT so_.zone_code,so_.cust_ship_to_id,
floor(substr(so_.end_time, 1, 2) / 8) end_time_shift, -- first 2 characters = hour
count(so_.end_time)
FROM csi.so_pick_detail so_
WHERE (so_.end_date = @variable ('Date'))
GROUP BY so_.zone_code, so_.cust_ship_to_id,
floor(substr(so_.end_time, 1, 2) / 8)
ASKER
sujith80
I get an error message when I run the code you provided.
ORA-01003: No statment parsed:-1003
I get an error message when I run the code you provided.
ORA-01003: No statment parsed:-1003
I recommend doing something like this instead of trunc on your end_date column,
if you have indexes on on the end_time column, writing the query like above will
prevent the use of those indexes, as illustrated below can use indexes.
sujith80's statement looks to be correct syntax though, did you miss a character in a cut-n-paste or something small like that?
if you have indexes on on the end_time column, writing the query like above will
prevent the use of those indexes, as illustrated below can use indexes.
sujith80's statement looks to be correct syntax though, did you miss a character in a cut-n-paste or something small like that?
SELECT so_.zone_code,
so_.cust_ship_to_id,
FLOOR(SUBSTR(so_.end_time, 1, 2) / 8) end_time_shift,
COUNT(so_.end_time)
FROM csi.so_pick_detail so_
WHERE so_.end_date >= TRUNC(SYSDATE) AND so_.end_date < TRUNC(SYSDATE + 1)
GROUP BY so_.zone_code, so_.cust_ship_to_id, FLOOR(SUBSTR(so_.end_time, 1, 2) / 8)
ASKER
sdstuber
I get a different error message this time.
ORA-01861: literal does not match format string:-1861
I get a different error message this time.
ORA-01861: literal does not match format string:-1861
you must not be storing dates as dates.
what is end_date? A string? what is the format of it?
what is end_date? A string? what is the format of it?
ASKER
FORMAT FOR END_DATE IS YYYY,MM,DD
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
See.
select sysdate from dual;
You may try the below suggestion. I have used a trunc function around the column to make sure that the time components are clipped. L
See whether this does for you.
Open in new window