Ashfaque
Search Beautiful Girls from your town for night
- Local time
- Today, 18:27
- Joined
- Sep 6, 2004
- Messages
- 894
My db contains a table called T_JobOffer where in 10s of job offer letter are available with diff data like departments, ProfessionName, ProfessionCode, Nationality etc.
I want to count the number of Expatriates worker and Local National Worker by Profession wize and Department wize. So we know which dept is lacking of national worker.
And save the generated summary in a table called T_Graph.
like below:
To do this task, I have this code lines which is giving me Run-time error 2342 - A RunSQL action requires an argument consisting of an SQL Statement
So please let me know if I doing right or there is any other way to get the summery of selected ProffGroupCode from the T_JobOffer table.
The T_Graph is tbl based on which I have placed graph. So each time I select different ProffGroupCode, the T_graph tbl previous data will be deleted and new data will be store to have updated graph.
Kindly support....
I want to count the number of Expatriates worker and Local National Worker by Profession wize and Department wize. So we know which dept is lacking of national worker.
And save the generated summary in a table called T_Graph.
like below:
CDept | CNationalityExp | ProffGroupName | ProffGroupCode | Sum Of Count Of T_JobOffer |
---|---|---|---|---|
Administration | Expats | Engineer | 1 | 1 |
Administration | Saudis | Engineer | 1 | 1 |
Inspection | Expats | Engineer | 1 | 6 |
Inspection | Saudis | Engineer | 1 | 1 |
Trading | Expats | Engineer | 1 | 2 |
To do this task, I have this code lines which is giving me Run-time error 2342 - A RunSQL action requires an argument consisting of an SQL Statement
Code:
Dim strSQL1, strSQL2 As String
strSQL1 = "SELECT DISTINCT T_JobOffer.CDept, T_JobOffer.CNationalityExp, Count(*) AS [Count Of T_JobOffer], T_JobOffer.ProffGroupName, T_JobOffer.ProffGroupCode " & _
"FROM T_JobOffer " & _
"GROUP BY T_JobOffer.CDept, T_JobOffer.CNationalityExp, T_JobOffer.ProffGroupName, T_JobOffer.ProffGroupCode, T_JobOffer.CNo, T_JobOffer.CLastWorkingDate, T_JobOffer.CCrNumber, T_JobOffer.CDept " & _
" HAVING ((Not (T_JobOffer.ProffGroupName) Is Null) AND ((T_JobOffer.ProffGroupCode)=1) AND ((T_JobOffer.CNo)>0) AND ((T_JobOffer.CLastWorkingDate) Is Null) AND ((T_JobOffer.CCrNumber)=2051223412) AND ((T_JobOffer.CDept)<> 'Operations' And (T_JobOffer.CDept)<> 'Top Management'));"
DoCmd.RunSQL strSQL1
strSQL2 = "UPDATE T_Graph " & _
"SET [CDept]= strSQL1.CDept, [CNationalityExp]=strSQL1.CNationalityExp, [ProffGroupName]=strSQL1.ProffGroupName, [ProffGroupCode]=strSQL1.ProffGroupCode"
DoCmd.RunSQL strSQL2
So please let me know if I doing right or there is any other way to get the summery of selected ProffGroupCode from the T_JobOffer table.
The T_Graph is tbl based on which I have placed graph. So each time I select different ProffGroupCode, the T_graph tbl previous data will be deleted and new data will be store to have updated graph.
Kindly support....