Jump to content

Recommended Posts

Hi, I have the following code:

SELECT v.account_number_institution AS inst,
 v.account_number,
 v.nurse_station,
 v.discharge_timestamp,
 s.form_name,
 s.date_form_modified,
 s.destination_address,
 s.destination_description,
 s.result_message,
 s.date_sent
FROM patient_visits v
 LEFT OUTER JOIN encounter_form_outgoing_status s
	 ON v.account_number = s.account_number
	 AND v.account_number_institution =
		 s.account_number_institution
WHERE v.discharge_timestamp
 BETWEEN convert(varchar(, getdate() - 1, 1)
	 AND convert(varchar(, getdate(), 1)
	 AND 'TZK' IN ('', v.account_number_institution)
ORDER BY v.account_number_institution,
	 v.nurse_station,
	 v.discharge_timestamp DESC,
	 s.date_form_modified DESC,
	 s.form_name, s.date_sent DESC

It returns the following results:

TZK 000000090316688 2012-11-13 16:12:07.000 NULL NULL NULL NULL NULL NULL
TZK 000000090316506 2012-11-13 11:57:08.000 NULL NULL NULL NULL NULL NULL
TZK 000000090316522 2012-11-13 11:09:30.000 NULL NULL NULL NULL NULL NULL
TZK 000000090316654 3E 2012-11-13 10:44:00.000 NULL NULL NULL NULL NULL NULL
TZK 000000090316548 3N3 2012-11-13 13:18:00.000 NULL NULL NULL NULL NULL NULL
TZK 000000090316480 CCU 2012-11-13 11:05:15.000 NULL NULL NULL NULL NULL NULL

However, when it comes to the discharges that were done today (on the 14th of November), they are not displayed. I don't get it, I thought that this would not be an issue. Am I missing something in my SQL code?

 

How can I get the MS-SQL schema and post it here?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.