SELECT statement using the MicroOlap DAC
am 09.08.2005 19:43:36 von Kerry Frater
------=_NextPart_000_0070_01C59D12.4044F3C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I am using Crystal Reports V9 developer to develop some proglets to run =
some reports.
I have developed a report to print detail from a mix of tables. Using =
the example CR application I am writing a first proglet to run this =
explicit report.
The difference is that the sample uses a TQuery whilst I am going to use =
the MySQLQuery. I have copied the SQL statement embedded in the CR =
report and added to my program. Except that I stripped out the grave =
accents. The code in the MySQLQuery SQL statement is=20
MyQ.SQL.Text :=3D 'SELECT MH.IdRef, MH.DateOpened,'+
'MH.Description, MHNames.PorOther, addresses.AddressRef,' +
'addresses.Line1, names.Surname, names.Title, names.Forename,' +
'addresses.Line2, addresses.Line3, addresses.Postcode, =
MHNames.Surname,' +
'telnos.NameRef, telnos.TelNumber, telnos.Description, =
MH.DateClosed,' +
'MH.ClientRef' +
'FROM (((FiLOS.telnos telnos INNER JOIN FiLOS.names names ON ' +
'telnos.NameRef =3D names.NameRef) INNER JOIN FiLOS.MHNames =
MHNames ON ' +
'names.NameRef =3D matternames.NameRef) INNER JOIN FiLOS.MH MH ON =
' +
'MHNames.IdRef=3DMH.MatterRef) INNER JOIN FiLOS.addresses '+
'addresses ON MHNames.AddressRef =3D addresses.AddressRef ' +
'WHERE MH.IdRef =3D '''+ MyIdRef + ''' ' +
'ORDER BY MH.IdRef';
This fails. Can someone please advise me.
Kerry
------=_NextPart_000_0070_01C59D12.4044F3C0--
Re: SELECT statement using the MicroOlap DAC
am 10.08.2005 11:52:15 von Mark Carson
'MH.ClientRef' +
'FROM ....
should be 'MH.ClientRef ' +
'FROM ....
could be other errors please send exact error message. Start your project with a query that runs 100% in a query browser first before adding it to the SQL.Text property. Also use SQL.Clear then multiple SQL.Add('SELECT ......') for each line below then spacing becomes less important.
Mark
Kerry Frater wrote:
>I am using Crystal Reports V9 developer to develop some proglets to run some reports.
>
>I have developed a report to print detail from a mix of tables. Using the example CR application I am writing a first proglet to run this explicit report.
>
>The difference is that the sample uses a TQuery whilst I am going to use the MySQLQuery. I have copied the SQL statement embedded in the CR report and added to my program. Except that I stripped out the grave accents. The code in the MySQLQuery SQL statement is
>
>MyQ.SQL.Text := 'SELECT MH.IdRef, MH.DateOpened,'+
> 'MH.Description, MHNames.PorOther, addresses.AddressRef,' +
> 'addresses.Line1, names.Surname, names.Title, names.Forename,' +
> 'addresses.Line2, addresses.Line3, addresses.Postcode, MHNames.Surname,' +
> 'telnos.NameRef, telnos.TelNumber, telnos.Description, MH.DateClosed,' +
> 'MH.ClientRef' +
> 'FROM (((FiLOS.telnos telnos INNER JOIN FiLOS.names names ON ' +
> 'telnos.NameRef = names.NameRef) INNER JOIN FiLOS.MHNames MHNames ON ' +
> 'names.NameRef = matternames.NameRef) INNER JOIN FiLOS.MH MH ON ' +
> 'MHNames.IdRef=MH.MatterRef) INNER JOIN FiLOS.addresses '+
> 'addresses ON MHNames.AddressRef = addresses.AddressRef ' +
> 'WHERE MH.IdRef = '''+ MyIdRef + ''' ' +
> 'ORDER BY MH.IdRef';
>
>This fails. Can someone please advise me.
>
>
>Kerry
>
>
--
Mark Carson
Managing
Integrated Product Intelligence/IPI CC CK 95/35630/23
Members : MH Carson and AG Carson
EMail : mcarson@ipi.co.za/mark@ipico.co.za/mcarson@pixie.co.za
snailmail : P.O. Box 36095 Menlo Park 0102, South Africa
Cell : +27 83 260 8515
Tel : +27 12 349 2786
Fax : +27 12 349 2787
This e-mail may contain PRIVILEGED AND/OR CONFIDENTIAL INFORMATION intended
only for use of the addressee. If you are not the addressee, or the person
responsible for delivering it to the person addressed, you may not copy or
deliver this to anyone else. If you received this e-mail by mistake, please
do not make use of it, nor disclose it's contents to anyone. Thank you for
notifying us immediately by return e-mail or telephone. INFORMATION PROVIDED
IN THIS ELECTRONIC MAIL IS PROVIDED "AS IS" WITHOUT WARRANTY REPRESENTATION
OR CONDITION OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO CONDITIONS OR OTHER TERMS OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE. THE USER ASSUMES THE ENTIRE RISK AS TO THE ACCURACY AND
THE USE OF THIS DOCUMENT.
--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc@m.gmane.org