[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: converting date-time to all numbers



How about making it a little more simple...

  1  select to_char(sysdate,'DDMMYYhhmmss')
  2* from dual
SQL> /

TO_CHAR(SYSDATE,'DDMMYYHHMMSS')
---------------------------------------------------------------------------
150699040626

Thanks,
Jay R Schutz
HR Systems
Ext. 8546

> -----Original Message-----
> From: Joe Johnson [SMTP:jejohn1216@SURFREE.COM]
> Sent: Tuesday, June 15, 1999 2:54 PM
> To:   Multiple recipients of list SQR-USERS
> Subject:      converting date-time to all numbers
>
> ----------
> From:   Johnson, Joe[SMTP:jejohn1216@surfree.com]
> Sent:   Tuesday, June 15, 1999 1:51 PM
> To:     'jejohn1216@surfree.com'
> Cc:
> Subject:        converting date-time to all numbers
>
> Hello, oh mighty SQRUG!
>
> I am trying to convert the current date and time to a field of numbers
> (this will be a 'batch number' field to uniquely identify the report).
>
> In my Process-Main Procedure, I have:
>
> print 'Batch Number:' (+2,1)
>    do Get-Current-DateTime()
>    do DD-MON-YYYY_HH:MI:SS_AM-to-pgm($AsOfToday,'',$DD,$MM,$YY,$TT)
>    let $HR = substr($AsOfNow,1,2)
>    let $MIN = substr($AsOfNow,4,2)
>    let $SEC = substr($AsOfNow,7,2)
>    let $ReportDate = $MM || $DD || $YY
>    let $ReportTime = $HR || $MIN || $SEC
>    let $BatchNbr = $ReportDate || $ReportTime
> print $BatchNbr (,20)
>
> my output, however, displays 1599111610
> for the date-time of  15-Jun-1999  11:16 AM
> I was wanting to see 150699111610
>
> Any ideas why everything displays except for the month?
>
> Is there some obvious problem with the 'let' statements that I'm missing
> here?
>
> We are using PS version 7.01 on Oracle 7, NT environment.
>
> Thanks in advance,
>
> Joe Johnson