Doctor Kronenbo
Registered User.
- Local time
- Today, 14:01
- Joined
- Oct 28, 2004
- Messages
- 28
Hi,
I'm trying to join together two tables "tblApplications and tblApplications1" in an SQL statement to combine results from the both of them. The present SQL statement used on just the one table is as follows:
varSQL = ""
varSQL = "SELECT tblApplications.* FROM tblApplications WHERE ( [dteIDOC] > #03/31/2005# and ([txtAction] = 'A' or [txtAction] = 'R' or [txtAction] = 'T' ) "
varSQL = varSQL & varNationality & " and "
varSQL = varSQL & " ( DateValue([dteActioned]) > #" & Format(DateValue(dteS - 1), "mm/dd/yyyy") & "# and DateValue([dteActioned]) < #" & Format(DateValue(dteF + 1), "mm/dd/yyyy") & "# )"
varSQL = varSQL & " and AgeInYears([dteDOB],[dteActioned]) > 17 "
varSQL = varSQL & varOffices
varSQL = varSQL & ") ORDER BY tblApplications.intStatus, tblApplications.dteApplicationRecd;"
I've tried everything I can think of but keep getting parameter or syntax errors...
I'm trying to join together two tables "tblApplications and tblApplications1" in an SQL statement to combine results from the both of them. The present SQL statement used on just the one table is as follows:
varSQL = ""
varSQL = "SELECT tblApplications.* FROM tblApplications WHERE ( [dteIDOC] > #03/31/2005# and ([txtAction] = 'A' or [txtAction] = 'R' or [txtAction] = 'T' ) "
varSQL = varSQL & varNationality & " and "
varSQL = varSQL & " ( DateValue([dteActioned]) > #" & Format(DateValue(dteS - 1), "mm/dd/yyyy") & "# and DateValue([dteActioned]) < #" & Format(DateValue(dteF + 1), "mm/dd/yyyy") & "# )"
varSQL = varSQL & " and AgeInYears([dteDOB],[dteActioned]) > 17 "
varSQL = varSQL & varOffices
varSQL = varSQL & ") ORDER BY tblApplications.intStatus, tblApplications.dteApplicationRecd;"
I've tried everything I can think of but keep getting parameter or syntax errors...
