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

equal date & time

Status
Not open for further replies.

p658484

Technical User
Feb 12, 2009
20
CA
Hello
Can I get a formula to get the following data

Date 1, time 1 = Date 2, time 2

I am trying to extract reports which have admission date & time equal to previous discharge date & time.

I know the formula to make the dates equal, but not one for equal date & time.
Thanks
 
datetime(date1,time1) = datetime(date2,time2)

This assumes that they are date and time datatypes.

-LB
 
Hello LB
Thanks for your response. This will work if you have one date and time value.
I am doing this for all discharges and admission for a whole year.
I need a formula to get the following results.

({I10_Abstract__VR.DischargeDate1},{I10_Abstract_VR.DischargeTime1})=({I10_Abstract_VR.AdmissionDate2},{I10_Abstract_And_Provider_VR.AdmissionTime}2)

Thanks.
 
I don't know what you mean, but the formula should be:

datetime({I10_Abstract__VR.DischargeDate1},{I10_Abstract_VR.DischargeTime1}) = datetime({I10_Abstract_VR.AdmissionDate2},{I10_Abstract_And_Provider_VR.AdmissionTime2})

-LB
 
Hello LB
When I use your fomula I am getting an error

'a date is required her' and {I10_Amcare_And_Provider_VR.DispositionDate} is highlighted.

I used the following formula:

datetime({I10_Amcare_And_Provider_VR.DispositionDate},{I10_Amcare_And_Provider_VR.DispositionTime}) =
datetime({I10_Abstract_And_Provider_VR.AdmissionDate},{I10_Abstract_And_Provider_VR.AdmissionTime})

I am unable to copy and paste the error box which appears in the crystal.
Thanks

 
You might be encountering null values. Try and Create isnull() check for each of the fields.
 
Hello
No null values. These are mandatory fields.
Thanks
 
First you need to determine the datatype of each field. You can do this by running your mouse over the field and observing the tooltip text or by right clicking on the field->browse field->datatype. Then report back with your results.

-LB
 
I have seen often where even though the program is asking you for a date, it is stored as a DateTime variable.

I ran a check on one of my reports and it gives me that exact error when I replicate the problem.

If this is the case change the first part of your formula to

datetime(date({I10_Amcare_And_Provider_VR.DispositionDate}),{I10_Amcare_And_Provider_VR.DispositionTime}) =
 
Hello dunlop1975
You are correct. These fields happen to be date/time fields. When I typed 'date' before the date field and 'time' before the time field, it worked perfectly.
Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top