Board index » delphi » HOURS: HOW CAN I TO STORE HOURS IN A FIELD SMALLDATIME

HOURS: HOW CAN I TO STORE HOURS IN A FIELD SMALLDATIME

Hello World.

 I am developing an application and I need that my user entry with
hours....just hours in a field. I am using DELPHI 3.0 with SQLSERVER7.0.

I am using SMALLDATETIME field ....but if I type just Hours it doesnt
work.
I already try to concatenate something thus : '01/01/98'+'  '+:HOURS
...but doesnt work again .Please help me.

Rovilson Mezencio  - Rib Preto - S?o Paulo - Brazil

 

Re:HOURS: HOW CAN I TO STORE HOURS IN A FIELD SMALLDATIME


Quote
rovilson wrote in message <37153F8E.86F67...@hotmail.com>...

> I am developing an application and I need that my user entry with
>hours....just hours in a field. I am using DELPHI 3.0 with SQLSERVER7.0.

>I am using SMALLDATETIME field ....but if I type just Hours it doesnt
>work.
>I already try to concatenate something thus : '01/01/98'+'  '+:HOURS
>...but doesnt work again .Please help me.

If it's really just hours (and/or minutes) you need to store then why not
just use an integer?

--
Wayne Niddery - WinWright Consulting
Delphi, C++Builder, JBuilder, InterDev --
http://home.ican.net/~wniddery/RADBooks.html
...remove chaff when replying...
"You know you've landed gear-up when it takes full power to taxi"

Re:HOURS: HOW CAN I TO STORE HOURS IN A FIELD SMALLDATIME


My Dear  Wayne Niddery (TeamB)

Quote
> I wrote:
> > I am developing an application and I need that my user entry with
> >hours....just hours in a field. I am using DELPHI 3.0 with SQLSERVER7.0.

> >I am using SMALLDATETIME field ....but if I type just Hours it doesnt
> >work.
> >I already try to concatenate something thus : '01/01/98'+'  '+:HOURS
> >...but doesnt work again .Please help me.

> and you wrote:
> If it's really just hours (and/or minutes) you need to store then why not
> just use an integer?

Ask :

 I need hours and minutes. I need to do many calculations with those HOURS. I
would like to use INTEGERS as last resource if dont have any better
solution. Is there other solution ???

Re:HOURS: HOW CAN I TO STORE HOURS IN A FIELD SMALLDATIME


Quote
Rovilson Mezencio wrote in message <3715D688.6C91A...@hotmail.com>...

> I need hours and minutes. I need to do many calculations with those HOURS.
I
>would like to use INTEGERS as last resource if dont have any better
>solution. Is there other solution ???

I don't know your exact needs, but I would just store the integer value as
the number of minutes (i.e. hours * 60 + minutes). This makes calculations
easy - always deal in minutes and only decode into hours:minutes for
display/entry.

--
Wayne Niddery - WinWright Consulting
Delphi, C++Builder, JBuilder, InterDev --
http://home.ican.net/~wniddery/RADBooks.html
...remove chaff when replying...
"You know you've landed gear-up when it takes full power to taxi"

Other Threads