Re: Invalid SQL Statement
- From: Bob Quintal <rquintal@xxxxxxxxxxxxx>
- Date: 28 Sep 2007 18:30:56 GMT
Susan Bricker <susan.l.bricker@xxxxxxxxxxxxx> wrote in
news:46fd4d45$0$500$815e3792@xxxxxxxxxxxxxx:
Hi. Does anyone have the patience and knowledge to determineWith such a long SQL statement,I format.
what's wrong with the following SQL statement (that is being
passed to my MAILMERGE routine)? I haven't a clue. The error
message doesn't really help. All is says is that the SQL
statement is not valid. Does it have too many characters? The
length of the statement is 1254.
Regards,
SueB
*** Sent via Developersdex http://www.developersdex.com ***
SELECT
tblDogTitles.dogtitleID,
tblDogTitles.dogregnbr,
tblDogTitles.processeddt,
tblDogTitles.multiplier,
Day(tblTrials.trialdt) & ' ' & MonthName(Month(tblTrials.trialdt)) &
' ' & Year(tblTrials.trialdt) AS outtrialdt,
tblTitles.title,
tblTitles.titleabbrev,
tblDogs.formalname,
tblPeople.fname & (''+tblPeople.midinit+'.') & ' ' &
tblPeople.lname & (' '+tblPeople.suffix+'.') AS owner,
tblPeople.altperson AS altowner,
IIF(titleabbrev = 'UDX-H' OR titleabbrev = 'OTCH-H',' ',' ' &
tblClasses.class & ' Class ') AS classtxt,
IFF(mulitplier > 1, multiplier, ' ') AS titlesuffix,
tblUserSettings.uval
FROM
tblUserSettings,
tblTrials
INNER JOIN
(
(
(tblClasses
INNER JOIN tblTrialClass
ON tblClasses.classID = tblTrialClass.classID
)
INNER JOIN tblTitles
ON tblClasses.classID = tblTitles.classID
)
INNER JOIN
( tblPeople
INNER JOIN
(tblDogs
INNER JOIN tblDogTitles
ON tblDogs.dogregnbr = tblDogTitles.dogregnbr
)
ON tblPeople.peopleID = tblDogs.peopleID
)
ON (tblTrialClass.trialclassID = tblDogTitles.trialclassID)
AND (tblTitles.titleID = tblDogTitles.titleID)
)
ON tblTrials.trialID = tblTrialClass.trialID
WHERE (tblDogTitles.processeddt = #9/28/2007 2:42:32 PM#)
AND tblUserSettings.uvar = 'U_Coordinator'
ORDER BY
tblDogTitles.dogregnbr, tblTitles.titleID
First thing that showed up is IFF(mulitplier > 1
I suspect that you want IIF
I'm not sure about the joins in the FROM segmant.but they're
probably ok.
As to the length, no problem.
--
Bob Quintal
PA is y I've altered my email address.
--
Posted via a free Usenet account from http://www.teranews.com
.
- Follow-Ups:
- Re: Invalid SQL Statement
- From: SueB
- Re: Invalid SQL Statement
- From: Susan Bricker
- Re: Invalid SQL Statement
- References:
- Invalid SQL Statement
- From: Susan Bricker
- Invalid SQL Statement
- Prev by Date: Re: Runtime For Dummies
- Next by Date: Invalid SQL Statement
- Previous by thread: Invalid SQL Statement
- Next by thread: Re: Invalid SQL Statement
- Index(es):
Relevant Pages
|