hi
Thanks for all your replies
I'm still having problem
i'll explain u what i'm trying to do
when a user sends enquiry for a product it goes to table propertyhittable where hitid the index. if the receiver replies to the enquiry, his reply goes to table mailbox and all subsequent mail correspondence goes to mailbox. now on my Inbox Page i have to dispaly all the enquiries like gmail (each mail clustered with all past correspondence)
I used the following query:
SELECT HitId,hitid as mailid,Login_Id,Star,Subject,Prop_Code,visitdate, replydate,mailread FROM propertyhittable WHERE login_id<>'71727' AND deleted=0 AND prop_code IN (SELECT prop_code FROM resi_sell WHERE login_id='71727' UNION SELECT prop_code FROM comm_sell WHERE login_id='71727' UNION SELECT prop_code FROM land_sell WHERE login_id='71727') UNION (SELECT mb1.Login_Id,mb1.Star,mb1.Subject,mb1.Prop_Code,mb1.maildate as visitdate, mb1.maildate as replydate,mb1.mailread,mb2.hitid,mb2.mailid FROM (SELECT hitid,max(mailid) as mailid FROM mailbox GROUP BY hitid) as mb2 INNER JOIN mailbox as mb1 on mb1.hitid = mb2.hitid AND mb2.mailid = mb1.mailid WHERE login_id<>71727 AND deleted=0 AND mb2.hitid IN (SELECT hitid FROM propertyhittable WHERE login_id='71727') ) ORDER BY replydate desc
i got
Server: Msg 241, Level 16, State 1, Line 1
Syntax error converting datetime from character string.
Any help?