newsgroups-index (beta)

Current group: comp.databases.

Advanced Mysql where clause

Advanced Mysql where clause  
andy.rich at earthlink.net
 Re: Advanced Mysql where clause  
Manu Pavy
From:andy.rich at earthlink.net
Subject:Advanced Mysql where clause
Date:11 Jan 2005 17:31:06 -0800
The tableauctions.EndDate > '" & oNow & "' in the beginning of where
clause is not working. All the other syntax is working correctly. I am
not sure if I have it setup correctly. Can anyone help?

strSQL = "SELECT"
strSQL = strSQL & " max(tblauctionbids.WinPrice) as highestPrice,"
strSQL = strSQL & " count(tblauctionbids.AID) as BidCount,"
strSQL = strSQL & " tblauctionitems.Title,"
strSQL = strSQL & " tblauctionitems.MinPrice,"
strSQL = strSQL & " tblauctionitems.IID,"
strSQL = strSQL & " tblauctionitems.AID,"
strSQL = strSQL & " tableauctions.StartDate,"
strSQL = strSQL & " tableauctions.EndDate"
strSQL = strSQL & " FROM tblauctionitems"
strSQL = strSQL & " LEFT OUTER JOIN tableauctions"
strSQL = strSQL & " ON (tblauctionitems.AID = tableauctions.AID)"
strSQL = strSQL & " LEFT OUTER JOIN tblauctionbids"
strSQL = strSQL & " ON (tblauctionitems.AID = tblauctionbids.AID)"
strSQL = strSQL & " WHERE tableauctions.EndDate > '" & oNow & "' AND
(Title LIKE '%" & oTitle(0) & "%'"

For i = 1 To UBound(oTitle)

strSQL = strSQL & " OR Title LIKE '%" & oTitle(i) & "%'"
Next
strSQL = strSQL & ") GROUP BY AID"
From:Manu Pavy
Subject:Re: Advanced Mysql where clause
Date:Wed, 12 Jan 2005 09:44:44 +0100
andy.rich@earthlink.net a fait part de :

> The tableauctions.EndDate > '" & oNow & "' in the beginning of where
> clause is not working. All the other syntax is working correctly. I am
> not sure if I have it setup correctly. Can anyone help?

[CUT]

> strSQL = strSQL & " ON (tblauctionitems.AID = tblauctionbids.AID)"
> strSQL = strSQL & " WHERE tableauctions.EndDate > '" & oNow & "' AND
> (Title LIKE '%" & oTitle(0) & "%'"

[CUT]


Hi, at first, you ask some help about database (SQL) but you mix the
applicative code and the sql code.
Is the MySQL date format is compatible whith the /oNow/ function in your
code ?
If you display the query, how does it like ? (echo or display or ... strSQL)

Manu
   

Copyright © 2006 newsgroups-index   -   All rights reserved   -   Impressum