Hello all..
I have the following:
sConn = "Provider=MSDataShape;Data Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & Settings.DatabaseName
sSQL = "SHAPE {"
sSQL = sSQL & "SELECT "
sSQL = sSQL & "Format$(dep_date,'mmm dd yyyy') AS depositdate, "
sSQL = sSQL & "gate, sname as sitename, rec_count, void_count, "
sSQL = sSQL & "cash_rec_count, check_rec_count, visa_rec_count, "
sSQL = sSQL & "dep1_amount, attendant_id.attendant "
sSQL = sSQL & "FROM (deposit INNER JOIN site ON deposit.gate = site.site)
"
sSQL = sSQL & "LEFT JOIN attendant_id ON deposit.attendant =
attendant_id.id_code "
sSQL = sSQL & "WHERE dep_date = #" & ClosingDate & "#"
sSQL = sSQL & "} AS depositdata "
sSQL = sSQL & "APPEND ({"
sSQL = sSQL & "SELECT "
sSQL = sSQL & "Format$(tdate,'mmm dd yyyy') AS transdate, site, "
sSQL = sSQL & "rec_num, acc_num, total_chrg, paymnt_typ, reason,
attendant_id.attendant "
sSQL = sSQL & "FROM trans LEFT JOIN attendant_id ON trans.attendant =
attendant_id.id_code "
sSQL = sSQL & "WHERE void = -1} "
sSQL = sSQL & "RELATE depositdate TO transdate, gate TO site"
sSQL = sSQL & ") AS transdata"
The database is Access97. All date fields are defined as type Date/Time.
transdata should contain 2 records.
When I execute each query seperately in Access, the Format$() function
returns '#Error'. When this statement is executed in my app, the first
Format$() succeeds, but the one in the SHAPE APPEND clause fails. I am also
executing the child query in another portion of my app as a simple select
and the Format$() function works properly.
Any ideas anyone?
Thanks in advance...
--
Michael White
Programmer/Analyst
Marion County, OR