[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



You might want to try just using a display to see if maybe you are printing
blanks over the month.  I pasted your code into one of my SQR's and using
display I got
06151999021527
$MM = 06
$DD = 15
$YY = 1999
$HR=02
$MIN=15
$SEC=27
for the date-time of 15-JUN-1999 02:15:27 PM
I'm running HRizon Version 8, Oracle 7.3, and NT

> -----Original Message-----
> From: Joe Johnson
> Sent: Tuesday, June 15, 1999 12:54 PM
> 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