|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
query problem
hi.....
i m getting error when run this query..can we form such query?????? strSQL = "SELECT distinct y.company_id,y.company_name,z.location_id,z.locati on FROM appointment_detail AS x INNER JOIN company AS y ON x.company_id = y.company_id AND appointment_detail AS x INNER JOIN location_table AS Z ON x.location_id=z.location_id ORDER BY y.company_name,z.location" error//////////// Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''. /sd/jobsearchasp2.asp, line 18 can any suugestion....................thanx |
|
#2
|
||||
|
||||
|
Hi
access is very weird when it comes to inner joins try the following: Code:
strSQL = "SELECT distinct y.company_id,y.company_name,z.location_id,z.locati on FROM (appointment_detail AS x INNER JOIN company AS y ON x.company_id = y.company_id) INNER JOIN location_table AS Z ON x.location_id=z.location_id ORDER BY y.company_name,z.location" hope this helps
__________________
Look! Its a ShemZilla ![]() ![]()
|
|
#3
|
||||
|
||||
|
u r genius.
its perfectlt working thanx a lot....... |
|
#4
|
||||
|
||||
|
no problem
![]() glad its working ![]() |
|
#5
|
||||
|
||||
|
above query i want to add "appointment_detail.expiry_date >=date()" becuss i want those entries which date is greter then current date for sorting.
pls once again solve my problem i tried but getting error...... thanx |
|
#6
|
||||
|
||||
|
Hi,
try using Now() Code:
appointment_detail.expiry_date >= Now() What error are you getting? |
|
#7
|
||||
|
||||
|
strSQL = "SELECT distinct z.location_id,z.location, y.company_id,y.company_name FROM (appointment_detail AS x INNER JOIN location_table AS z ON x.location_id = z.location_id) INNER JOIN company AS y ON x.company_id=y.company_id" & " AND appointment_detail.expiry_date >=now() ORDER BY z.location ,y.company_name" Microsoft OLE DB Provider for ODBC Driverserror '80040e14' [Microsoft][ODBC Microsoft Access Driver] Syntax error in JOIN operation. /sd/jobsearchasp2.asp, line 20 |
|
#8
|
||||
|
||||
|
Hi,
you must use a WHERE clause try this: Code:
strSQL = "SELECT distinct z.location_id,z.location, y.company_id,y.company_name FROM (appointment_detail AS x INNER JOIN location_table AS z ON x.location_id = z.location_id) INNER JOIN company AS y ON x.company_id=y.company_id WHERE appointment_detail.expiry_date >=now() ORDER BY z.location ,y.company_name" hope this helps |
|
#9
|
||||
|
||||
|
still showing error............
Microsoft OLE DB Provider for ODBC Driverserror '80040e10' [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. /sd/jobsearchasp2.asp, line 21 |
|
#10
|
||||
|
||||
|
how does the code look now?
|
|
#11
|
||||
|
||||
|
Hi
also change Code:
appointment_detail.expiry_date to Code:
x.expiry_date |