Alastair, Consider using the FORMAT function SET VAR vNowDT = .#NOW SET VAR vTxtDay = (FORMAT(.vNowDT,'MM')) -- JUNE RETURNS '06' Following can replace all your coding with: SET VAR VTxtNOW = (FORMAT(. vNowDT,'YYYY/MM/DD HH:NN')) Set documentation in FUNCTIONS.PD
Jim Bentley American Celiac Society [email protected] tel: 1-504-737-3293 ----- Original Message ---- From: Alastair Burr <[email protected]> To: RBASE-L Mailing List <[email protected]> Sent: Wed, June 9, 2010 5:10:49 PM Subject: [RBASE-L] - Re: v9.0 INT day/month/year Thank you, Razzak, unfortunately I'm not using a date variable I'm using a DATETIME variable which the help indicates is valid: Where arg is a value that has either a DATE or DATETIME data type, IDAY returns the integer day of the month for a particular date. Returns the integer month for a particular date, where arg is a value that has a DATE or DATETIME data type. Where arg is a value that has a DATE or DATETIME data type, IYR4 always returns a four-digit integer year of date, I'm not actually using the old IYR - I found that because I left off the 4 when I was first checking. This used to work in v7.6: SET VAR vNowDT = .#NOW SET VAR vTxtDay = (CTXT( (IDAY(.vNowDT)) )) SET VAR vTxtMon = (CTXT( (IMON(.vNowDT)) )) SET VAR vTxtYear = (CTXT( (IYR4(.vNowDT)) )) IF (SLEN(.vTxtDay)) < 2 THEN SET VAR vTxtDay = ('0' + .vTxtDay) ENDIF IF (SLEN(.vTxtMon)) < 2 THEN SET VAR vTxtMon = ('0' + .vTxtMon) ENDIF SET VAR vNowText = + (.vTxtYear + '/' + .vTxtMon + '/' + .vTxtDay & (SGET( (CTXT( (TEXTRACT(.vNowDT)) )), 5, 1)) ) The day & month fail in v9.0 so I get, as an example: 2010/00/00 23:11 This then gets added to some more text... Regards, Alastair. -------------------------------------------------- From: "A. Razzak Memon" <[email protected]> Sent: Wednesday, June 09, 2010 9:03 PM To: "RBASE-L Mailing List" <[email protected]> Subject: [RBASE-L] - Re: v9.0 INT day/month/year > On 6/9/10, Alastair Burr <[email protected]> wrote: >> ----------------------------Am I imagining this or just going nuts: >> >> R>SET VAR vIntYear INTEGER = (IYR4(.#Now)) ; SHOW VAR vIntYear >> 2010 >> R>SET VAR vIntYear INTEGER = (IYR(.#Now)) ; SHOW VAR vIntYear >> 0 >> R>SET VAR vIntMon INTEGER = (IMON(.#Now)) ; SHOW VAR vIntMon >> 0 >> R>SET VAR vIntDay INTEGER = (IDAY(.#Now)) ; SHOW VAR vIntDay >> 0 > > Alastair, > > Here's how: > > SET VAR vIntYear INTEGER = (IYR(.#DATE)) > SET VAR vIntMon INTEGER = (IMON(.#DATE)) > SET VAR vIntDay INTEGER = (IDAY(.#DATE)) > > Very Best R:egards, > > Razzak. > >

