|
-
Aug 22nd, 2000, 12:51 PM
#1
Thread Starter
Lively Member
still getting attitude
basically trying to combine 2 tables into an object and selecting recordsets based on the date and then sorting them out heres what i got so far:
'sSQL1 = "SELECT * FROM [Customer Info] WHERE [Cust ID Number] in( SELECT [Cust ID Number] FROM Appointments WHERE Appointments.Date BETWEEN #" & sDateFrom & "# And #" & sDateTo & "# )"
'sSQL1 = "SELECT * FROM Appointments WHERE Date BETWEEN #" & sDateFrom & "# AND #" & sDateTo & "# ORDER BY Appointments.Date,Appointments.Time"
sSQL1 = "SELECT * FROM Appointments WHERE Date BETWEEN #" & sDateFrom & "# AND #" & sDateTo & "# ORDER BY Appointments.Date,Appointments.Time WHERE [Cust Info] WHERE [Cust Info.Cust ID Number]=[Appointments.Cust ID Number]"
Set apptRSResult = mdiDBMain.objDataBase.OpenRecordset(sSQL1, dbOpenSnapshot) 'new rs from sdatefrom to sdateto
-
Aug 22nd, 2000, 04:53 PM
#2
Frenzied Member
The first two statements appear, at a glance, to be ok. The last statement has problems (if your code is as exactly as written [only one openrecordset statement], then the last statement is the only one that will be executed):
sSQL1 = "SELECT * FROM Appointments WHERE Date BETWEEN #" & sDateFrom & "# AND #" & sDateTo & "# ORDER BY Appointments.Date,Appointments.Time WHERE [Cust Info] WHERE [Cust Info.Cust ID Number]=[Appointments.Cust ID Number]"
might work better if it were written
sSQL1 = "SELECT a.* FROM Appointments a, [Cust Info] b WHERE Date BETWEEN #" & sDateFrom & "# AND #" & sDateTo & "# and [Cust Info.Cust ID Number]=[Appointments.Cust ID Number]" ORDER BY a.Date,a.Time"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|