Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Derived Fields to pull total hours for different months

Status
Not open for further replies.

ttrsnoob

Technical User
Sep 8, 2008
13
US
I would like to put together a report that pulls total hours. I would need one dirived field for January and another field for February. Any ideas how I can do this?

Thanks
 
Here is what I was trying
SELECT
((SUM( DECODE("PS_AL_CHK_HRS_ERN"."ROW_NBR",'2',"PS_AL_CHK_HRS_ERN"."AL_HOURS",0 ) )) + (SUM( DECODE("PS_AL_CHK_HRS_ERN"."ROW_NBR",'1',"PS_AL_CHK_HRS_ERN"."AL_HOURS",0 ) )) + ( SUM( DECODE("PS_AL_CHK_HRS_ERN"."ERNCD",'H',"PS_AL_CHK_HRS_ERN"."AL_HOURS",0 ) ) ) + (SUM( DECODE("PS_AL_CHK_HRS_ERN"."ERNCD",'I',"PS_AL_CHK_HRS_ERN"."AL_HOURS",0 ) )) + (SUM( DECODE("PS_AL_CHK_HRS_ERN"."ERNCD",'L',"PS_AL_CHK_HRS_ERN"."AL_HOURS",0 ) )) + ( SUM( DECODE("PS_AL_CHK_HRS_ERN"."ERNCD",'E',"PS_AL_CHK_HRS_ERN"."AL_HOURS",0 ) ) ))
FROM
PS_AL_CHK_HRS_ERN
WHERE
"PS_AL_CHK_HRS_ERN"."CHECK_DT" BETWEEN <<FIRST_MO_START, "TO_DATE('"yyyy"-"mm"-"dd"', 'YYYY-MM-DD')">> AND <<FIRST_MO_END, "TO_DATE('"yyyy"-"mm"-"dd"', 'YYYY-MM-DD')">>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top