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

Recalculate a field before inserting it into a grid.

Status
Not open for further replies.

safarijoe2000

Programmer
Jul 25, 2002
38
GB
Hello,

Got a grid(myGrid), which shows fields from a table(myTable). One of these fields is a numeric value(myTable.TotalMinutes).

What I would like to do, is to convert myTable.TotalMinutes into a HH:MM format, so it will be shown on my Grid as that.

Basically, I don't want my Grid to show a field with just minutes, but rather Hours and Minutes.

How could I achieve this?

Any help will be appreciate.

Thanks
 
safarijoe2000

There is a function that does that show in thread184-369416 Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
HI Joe,

If this is a read only table requirement.. you can use..

SELECT *, STR(FLOOR(myTime/3600),2)+":" + ;
STR(FLOOR(MOD(myTime,3600)/60),2)+":"+ ;
STR(MOD(myTime,60),2) as cTime FROM myTable ;
INTO CURSOR myCursor ORDER BY .....

You can use this as your record source of the grid. :)
ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top