Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why this does not work
Message
From
23/08/2006 20:02:54
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Why this does not work
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01148070
Message ID:
01148070
Views:
58
Hi friends
am just wondering why followin syntax does not work ?? am trying last result date and last result value of each patient.

SELECT
master.NHI as Patient_Numbers_UR_Number,;
master.name as Name_Address_Full_Known_Name,;
(SELECT MAX(rp.resdate) FROM res_pat as rp WHERE ;
rp.master = rp1.master) as Last_result_date,;
(select rp4.value from res_pat as rp4 where rp4.master=rp1.master ;
and rp4.resdate in (SELECT MAX(rp.resdate) FROM res_pat as rp WHERE rp.master = rp1.master)) as [Column4]

from master inner join res_pat as rp1 on master.pkey = rp1.master;
where rp1.pkey in ;
(select res_pat1.pkey FROM master,;
test_pat test_pat1, test test2, res_pat res_pat1;
WHERE ;
(UPPER (PADR(test2.Name,30)) LIKE "BMI");
AND year (res_pat1.Resdate) = 2005 AND;
(master.status = 0 AND test_pat1.MASTER = master.PKEY AND test_pat1.status < 2;
AND test_pat1.TEST = test2.PKEY AND test2.status < 2;
AND res_pat1.TEST_PAT = test_pat1.PKEY AND res_pat1.status < 2);
);
group by 1,2,3,4

it works perfectly in my sql server database but not in foxpro. btw abv command works nicely in foxpro too if i remove "column4".
any ideas ?
Next
Reply
Map
View

Click here to load this message in the networking platform