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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Abstracting the Month and Year from a timestamp 1

Status
Not open for further replies.

funkmonsteruk

IS-IT--Management
Feb 8, 2002
210
GB
I'm running a BO query over an NT platform using a DB2 database and i'm having a few problems using a date as a criteria.

For the criteria that i'm using i need only the month and year part of the datestamp of a particular field. I've tried formatting the day part out of the equation, but this is not effective.

Does anybody have any suggestions???

[cannon]
 
Universe Level.... Or maybe creating a user object at report level.....
 
Hello Funk,

I am working on DB2 on NT too, so we should be able to resolve this. Did you try using standard DB2 functions on the timestamp , for instance creating a new object from year part concatenated with the month?

T. Blom
Information analyst
tbl@shimano-eu.com
 
Didn't try that Blom, how would i go about doing that... I'm guessing something along the lines of month(DATE(<date1>))|| '/'||YEAR(DATE(<date1>)

 
Blom,

I've tried using this DATE(MONTH(LLPSC01U.PSC_ESTA.DTH_DT)) || '/' || DATE(YEAR(LLPSC01U.PSC_ESTA.DTH_DT))

I'm getting an error message - something like The data type, length or value of argument &quot;1&quot; of routine &quot;!!&quot; is incorrect... Any suggestions
 
Try this:

CHAR(MONTH(LLPSC01U.PSC_ESTA.DTH_DT))||'/'||
CHAR(YEAR(LLPSC01U.PSC_ESTA.DTH_DT))

and set the datatype to string

T. Blom
Information analyst
tbl@shimano-eu.com
 
Cool, cheers once again blom..... Works great. Think you deserve a star......
 
you're welcome, really love stars.............. :)

T. Blom
Information analyst
tbl@shimano-eu.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top