0

Hi,
Iam using ms sql server.Iam using a hospital management system .I need to find the last visit of the patient,only the last visit date,How can i do that?I think that it is as same as the latest published text,one of my friend told me,But how can i do that? PLz help me,a help is more appreciated,Thanks in adv

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by mathewmoozh
0

I think you have to change your datatype date into timestamp.By selecting maximum timestamp , you can find the last visited patient.

For example -
Name ID(timestamp)

'a', '2010-09-08 10:43:20'
'b', '2010-09-08 10:44:17'
'c', '2010-09-08 10:44:37'
'd', '2010-09-08 10:44:44'
'e', '2010-09-08 10:44:50'
'f', '2010-09-08 10:44:57'
'a', '2010-09-08 10:45:02'
Now I can find entered name in my database on the same date. query will be like-
select name,id from p where id=(select max(id) from p);

0

Thanks for the reply
I am not asking the last visited patient but the last visit of the particular patient for example i have to find the last visit of the patient named 'Ram'.Since the consulting fee is remitted once for 20 days

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.