Link to home
Create AccountLog in
Avatar of AMS_RN
AMS_RN

asked on

Convert str to date and then compare

I need to compare 2 date fields; one is a string, the other is a datetime.  The string is in the yyyymmdd format.  How do I convert these two data types, and then compare them?  I will want to display data where the data associated with the string is more recent than the datetime.
Avatar of MaduKp
MaduKp
Flag of Sri Lanka image

Could you please give more details?
what is the database?
what is the programming language you are using?
Avatar of AMS_RN
AMS_RN

ASKER

Sorry about that;  I'm using Crystal Reports XI, and the database is in sql (it's a healthcare database.)  I am comparing the date that a medication was stopped (which is a string) to the date of the office visit (which is a datetime).  I only want to display medications that have a stop date AFTER the office visit date (so the medication is still current when the patient leaves the clinic).
ASKER CERTIFIED SOLUTION
Avatar of MaduKp
MaduKp
Flag of Sri Lanka image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer