Bring Count Value back as a Half

natural

Registered User.
Local time
Today, 10:23
Joined
Sep 4, 2006
Messages
57
Good Morning

I was hoping someone could possible assist.

I am currently using some of the Calendar sample database posted by "oxicottin"

Currently in a Table called TblInput the records gets added for various types of Employee Absences, On the form it then counts these records based ont the input text of the records (ie "vacation") for the employees to see how many days the employee went to the Dentis or Doctor.

I do however added an input called half a day and was hoping that instead of returning the value one on a count of records for that specific record it would bring back .5


Code:
'Worked Half A Day
strSql = "SELECT Count(InputID) AS TotDays FROM tblInput "
strSql = strSql & "WHERE ((Format([InputDate], 'yyyy')=" & CInt(gstrYear) & ") AND ((tblInput.UserID)=" & glngUserID & ") AND ((tblInput.InputText)='Half Day'));"
Set rs = db.OpenRecordset(strSql, dbOpenSnapshot)
frm!txtHD= rs!TotDays
rs.Close
strSql = "'"
[/code]

So Where the summary would calculate a value of 1 is it possible to say if intput text = "half Day" give value 0.5 not 1

Is it possible for it to return a value of 0.5

for the following

strSql = "SELECT Count(InputID) AS TotDays FROM tblInput "

Is this possible.
Thank you so much in advance

Regards
N
 
Count can only return integers, not fractions, as it counts the number of records....

Maybe if you use an IIF and a sum
Select Sum(Iif (tblInput.InputText='Half Day',0.5,1)) AS TotDays
 
Absolutely Brilliant

Thank you very much for youre help...
 

Users who are viewing this thread

Back
Top Bottom