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

HYYMDS

Status
Not open for further replies.

pvuppa1

Programmer
Nov 14, 2003
61
0
0
US
how can I print the time field (value=3/24/2003 11:44:00 AM) exactly as in SQL database. when i tried to print it prints only 3/24/2003 but not the whole time stamp.
In other words I need to print full time stamp. I tried to change the attribute in the masterfile from YYMD to HYYMDS but, it did not help..am I missing something here?
Please help

-P
 
YYMD is a smartdate, not a timestamp - this is why changeing the master did not work. If the master that you tried changing is for DB2 then you can change both the USAGE and the ACTUAL to HYYMDS.

If you are trying to put an HYYMDS field together use DT(dateString [timeString]).

 
Can you be more specific on what I have to do?
any example using DT(DATESTRING [TIMESTRING])?
all I have is a datefield in YYMD, but the actual data in sql database is of the format 3/24/2003 11:44:00 AM and I need to print just like it is.

-P
 
Given that your master is for a sql database, all you have to do is change both the usage and the actual formats.

FIELD=MYDATE, ALIAS=MYDATE, USAGE=YYMD, ACTUAL=YYMD,$ needs to be changed to --
FIELD=MYDATE, ALIAS=MYDATE, USAGE=HMDYYSA, ACTUAL=HYYMDS,$

An example of the DT function would be
COMPUTE DTTIMESTAMP/HYYMDS = DT(20031230 12:13:14);

For the change in the master - notice that the usage is HMDYYSA. This puts the timestamp in m/d/yy format showing up to the seconds (a small "s" will give milliseconds) with AM/PM.

Other options are:

H - shows the hour
I - Hours:Min
m - micro seconds
a - lower case am/pm
 
Im getting this error
focus(1383) UNSUPPORTED DATETIME FORMAT FOR FIELD: EUPDATEDTIME

Master File:
FIELD=EUPDATEDTIME ,eUpdatedTime,
USAGE=HYYMDS, ACTUAL=HYYMDS, MISSING=ON
,$

Procedure file:
TABLE FILE MYFILE
PRINT EUPDATEDTIME
END
Looks pretty simple to me but can't figure out whats wrong...
 
Mmmmm.... Try changing the 'S' on the actual format to a lower case 's'. If that doesn't work, could you post the sql that created eUpdatedTime?

Also, what version of focus/webfocus are you using?
 
lower case 's' works !!!!!
Thanks a lot gizzy
 
DT() will also accept slashes in the date. In most of our reports, we have &StartDate and &EndDate that signify a date range. In the WHERE section, we have:
WHERE timefield GE DT(&StartDate) AND timefield LT DT(&EndDate);

The users can type any of the following without any adverse effects (we're using Oracle 8i & 9i and HYYMDS in the Master):
01/05/2004
01/05/2004 12:00
01/05/2004 13:59:59

You can check the values of your date parameters using JavaScript or Dialogue Manager. ...just remember that text box values & amper variables are always strings!! 8^)

I hope you find this useful.
-Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top