Showing posts with label enter. Show all posts
Showing posts with label enter. Show all posts

Wednesday, March 28, 2012

How to Show Last Admit Date

I have a report that shows patient information, such as patient number, name, and admit date. It also has a date parameter. I enter in the date and it shows all the patients admitted that day. I would like to show the last date the patient was admitted before the date I ran the report for.

For example, if I run the report for 12/20/06, I want to see the patients that were admitted that day and their info like name, and patient number. I would also like to see the last date they were admitted.

Could you just do a subquery to get the max date for each patient from before the date parameter? Something like this:

select ...
(select max(admit_date) from patient_admittances pa where p.patient_id = pa.patient_id and admit_date < @.RunDate)
from patients p
inner join ...

Jarret

Friday, March 9, 2012

How to set right utf-8 in sql server 2005 db?

Hello,

I try to insert some data in Vietnamese into sql server db from Sql server management studio express.

I enter an insert query with some unicode data like this 'm?t hai ba b?n n?m sáu b?y tám chín m??i', and I expect the db should contain the same text as above.

However, what I retrieved is 'm?t hai ba b?n nam sáu b?y tám chín mu?i'.

Can anyone help? Many thanks.

maivangho

Hi~ you may check you server's regional settings in control panel, and set all those to your language related, and check<globalization> section of config file.

If it still doesn't work, underSystem.Text there are some classes for encoding/decoding, you may try encode your data before putting them into DB... though this is not a good walkaround..