Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Command contains unrecognized phrase/keyword - vfp

Author  Topic 

sikharma13
Starting Member

44 Posts

Posted - 2013-10-26 : 02:13:04

please help... due to limited number of characters..
no query cant be read by visual fox pro..due to error 36..

foxpro via mysql...here is the query..

SQLExec(nPayroll,"insert into py_abcdeeh(province,municipality,barangay,household_id,entry_id,lastname,firstname,middlename,ext_name,no_eli_for_educ_grant)
select m1.province,m1.municipality,m1.barangay,m1.household_id,m1.entry_id,m1.last_name,m1.first_name,m1.middle_name,m1.ext_name ,m2.count
from m_abcdeeh m1
inner join (select household_id,sum(case when eligible_for_educ_grant = 'yes' then 1 else 0 end) as count
FROM m_abcdeeh
GROUP BY household_id
)m2
on m2.household_id = m1.household_id
where m1.grantee = 'yes'")

SQLExec(nPayroll,Query)
SQLExec(nPayroll,"select * from py_abcdeeh","abcdeehtemp")
Thisform.grdPayroll.RecordSource = "abcdeehtemp"
..
i did something like this but the query is not working anymore..
is there something wrong?? here is the query..


Query = ["insert into py_abcdeeh(province,municipality,barangay,household_id,entry_id,lastname,firstname,middlename,ext_name,no_eli_for_educ_grant)];
+[select m1.province,m1.municipality,m1.barangay,m1.household_id,m1.entry_id,m1.last_name,m1.first_name];
+[,m1.middle_name,m1.ext_name ,m2.count];
+[from m_abcdeeh m1];
+[inner join (select household_id,sum(case when eligible_for_educ_grant = 'yes' then 1 else 0 end) as count];
+[FROM m_abcdeeh GROUP BY household_id];
+[)m2 on m2.household_id = m1.household_id];
+[where m1.grantee = 'yes'","abcdeehtemp"]

SQLExec(nPayroll,Query)
SQLExec(nPayroll,"select * from py_abcdeeh","abcdeehtemp")
Thisform.grdPayroll.RecordSource = "abcdeehtemp"

..thank you so much for the help..



VFP9.0 via MySQL 5.0

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2013-10-26 : 03:22:56
SQLTeam.com is on Microsoft SQL Server there aren't many are familiar with Fox Pro + MySQL, you will get better help at a mysql site or foxpro site


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -