SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Command contains unrecognized phrase/keyword - vfp
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sikharma13
Starting Member

Philippines
44 Posts

Posted - 10/26/2013 :  02:13:04  Show Profile  Reply with Quote

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)

Singapore
17681 Posts

Posted - 10/26/2013 :  03:22:56  Show Profile  Reply with Quote
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
Time is always against us

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000