well I have a table
create table usersnew
(
user1 varchar (50) primary key,
names varchar(50),
lastname varchar(50),
hoursneeded float)
create table hoursusers
(
user1 varchar(50),
timeMade varchar(50),
foreign key (user1) references usersnew(user1)
)
hoursneede is how time the user need to make for finish his service.. “social service”
it can be 400 hours..
now timeMade is how time he has made..
it is varchar because i save something as this “30:00:00”
it is 30 hours
’23:30:00′ it is 23 hours and 30 minutes
so .. i convert it in C# with timespan and another things..
now I need to make a query where
I select to all users where timeMade was more than Hoursneede …
if he need to make 400 and he has made ‘400:00:00’ or plus I am going to select him..
but not all user need to make the same time..
another users need to make 450 or 300 I don’t know… but I want to select to users
than has finished with his time needed.. how can I do it? I can use sql for this query and
c # with loops-for, for do it… some idea?
Use minutes instead, with numeric data type
you can easily convert minutes to hours by dividing to 60
and numeric data is easier to query