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

Macola Time conversion

Status
Not open for further replies.

wwwedward

IS-IT--Management
Oct 26, 2003
161
US
How do you convert macola time format "103212" into time?
 
Assumming you are talking about crystal reports, try this:

Time(Left{TimeField},2),Mid({TimeField},3,2),right({TimeField},2))

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
It is an "int" format in SQL. It is the po histroy date field in macola. I tried timevalue(timefield) and it came up with the same time acroos the board?? I think I can just use the max function without converting this field to pick the most recent record in PO history header.

Thanks I need to find my crystal function ref..
 
I did the following 4 formula's in crystal though they probably could be combined

--Hour--
if len(ToText({IMINVTRX_SQL.trx_tm},0,"","")) = 6 then
tonumber(left(ToText({IMINVTRX_SQL.trx_tm},0,"",""),2)) else
tonumber(left(ToText({IMINVTRX_SQL.trx_tm},0,"",""),1))

--Minute--
if len(ToText({IMINVTRX_SQL.trx_tm},0,"","")) = 6 then
tonumber(mid(ToText({IMINVTRX_SQL.trx_tm},0,"",""),3,2)) else
tonumber(mid(ToText({IMINVTRX_SQL.trx_tm},0,"",""),2,2))

--Second--
if len(ToText({IMINVTRX_SQL.trx_tm},0,"","")) = 6 then
tonumber(mid(ToText({IMINVTRX_SQL.trx_tm},0,"",""),5,2)) else
tonumber(mid(ToText({IMINVTRX_SQL.trx_tm},0,"",""),4,2))


--Time--
Time({@Hour},{@Minute},{@Second})

Kevin Scheeler
 
Selecting the Max(Hst)Tm) field (by itself) will not return the last record written to the table since a record may have been written later in the day on an earlier day!

To select the last record written today or the last record for a specific PO, you could select Max(Hst_Tm) Where Hst_Dt = <Today> or Where Ord_No = <My PO No>, etc.

Another reliable way to select the last record in a table is to selct the Max(A4GLIdentity) column. This is an ID column that will always be incremented by SQL.
 
Thanks for all the assitance. We have got this one covered on two angles. I was looking at the al4aglid field and still needed time conversion etc..

I feel like it is christmas early being able to get this done prior to santa arriving.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top