Stored date in a query

R

RedForeman ©®

I have Surgery_Date, and SkinCutStartTime and SkinCutStopTime

I started with this, Time1: (([SkinCutStopTime]-[SkinCutStartTime])*1440)
which will result in positive numbers, correct numbers IF the surgery ended
on the same day.

Problem is, for a case that went past midnight, it shows a negative number.

My question is this, I've had 3 people in town give me 3 different queries,
and none work, the only ones that have worked are the ones from Ken Wright,
George Nicholson, and Gary Walter.. I'm hoping one of these gurus can take
this and point me in a direction that will help me find the answer... Some
common fixes were given that could in short term give the answer, but this
will be hard coded in form and I hate GIGO queries, so here I am again....
I started with this, but...
Time1: (([SkinCutStopTime]-[SkinCutStartTime])*1440)
it gave negative numbers...

ORTime: IIf((([SurgeryDate]([SkinCutStopTime]-[SkinCutStartTime])<=0),
*1440)

I'm still not sure if this will work, I keep getting syntax errors, and
operator errors, (operator being me) hahaha....

any help, suggestions, corrections, critiques are welcomed....

This is the last query I had to write.. needless to say, it DID take awhile
to get the range figured out...
Range: IIf((CInt([LOS_SD])<=3 And
CInt([LOS_SD])>=0),"<=3",IIf(CInt([LOS_SD])=4,"4",IIf(CInt([LOS_SD])=5,"5",I
If((CInt([LOS_SD])=6 Or CInt([LOS_SD]=7)),"6-7",IIf((CInt([LOS_SD])=8 Or
CInt([LOS_SD]=9)),"8-9",IIf(CInt([LOS_SD])=9,"9",IIf(CInt([LOS_SD])>=10,">=1
0","0")))))))



--
RedForeman ©® future fabricator and creator of a ratbike streetfighter!!!
==========================
2003 TRX450ES
1992 TRX-350 XX (For Sale)
'98 Tacoma Ext Cab 4X4 Lifted....
==========================
ø¤°`°¤ø,¸¸¸,ø¤°`°¤ø,¸¸¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸¸¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø


is that better??
 
M

MGFoster

RedForeman said:
I have Surgery_Date, and SkinCutStartTime and SkinCutStopTime

I started with this, Time1: (([SkinCutStopTime]-[SkinCutStartTime])*1440)
which will result in positive numbers, correct numbers IF the surgery ended
on the same day.

Problem is, for a case that went past midnight, it shows a negative number.

My question is this, I've had 3 people in town give me 3 different queries,
and none work, the only ones that have worked are the ones from Ken Wright,
George Nicholson, and Gary Walter.. I'm hoping one of these gurus can take
this and point me in a direction that will help me find the answer... Some
common fixes were given that could in short term give the answer, but this
will be hard coded in form and I hate GIGO queries, so here I am again....
I started with this, but...
Time1: (([SkinCutStopTime]-[SkinCutStartTime])*1440)
it gave negative numbers...

ORTime: IIf((([SurgeryDate]([SkinCutStopTime]-[SkinCutStartTime])<=0),
*1440)

I'm still not sure if this will work, I keep getting syntax errors, and
operator errors, (operator being me) hahaha....

any help, suggestions, corrections, critiques are welcomed....
< SNIP >

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use the DateDiff() function. This assumes the Start & Stop times are
full Date/Time values. E.g.: 4/16/2004 10:48 AM.

Time1: DateDiff("s", SkinCutStartTime, SkinCutStopTime)

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQIAdFYechKqOuFEgEQKMjQCgiY1uKhgmQDlX8mzJVV6jo2z4/VQAnRHp
dsmspal8w3W9JxZZr87reFn7
=1wBQ
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top