I need a query in SQL to run every new patient that has been created in the DB since 9/21/2015.I just need the ones that have been created but necessarily have been seen. Are there any SQL experts out there that can help? Please let me know. Thanks!
Not a Sql expert, but this one seems pretty simple.
select * from patientprofile where created > '9/21/2015'
You could add order by created to get them in the order they were made or order by last to get them ordered by last name, etc...
Am I missing something?
-Matt
Matt,
Is there a function I can throw in there to exculde Merged patients?
try this... I think you just needed to format your date.
select * from patientprofile where created > '2015-09-21 00:00:00.000' and last not like '<mrg>'
That should be...
Last NOT LIKE '%<mrg>%'
Don't forget the percent signs. You may also want to throw in AND pstatus = 'A' so you only get the active patients. That should filter out the merges as well.