Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp EOF - but query executes in mysql

Status
Not open for further replies.

thompom

Technical User
Dec 4, 2006
395
GB
Hi,

i dont think this is a sql syntax prob as when i execute the query from mysql it runs fine and displays a recordset.

However when i run the query from my asp page it returns eof.

this is because of this part of the statment
Code:
sum(TO_DAYS(CBB.bookend) - TO_DAYS(CBB.bookst) + 1) AS holcount

i am opening the rs like this
Code:
Set rsside = Server.CreateObject("ADODB.Recordset")
rsside.Open sqlside, conn

and have tried
Code:
set rsside = conn.execute(sqlside)

the sql looks like
Code:
SELECT CC.code, sum(TO_DAYS(CBB.bookend) - TO_DAYS(CBB.bookst) + 1) AS holcount, CC.holtype FROM holtype AS CC LEFT JOIN (SELECT CB.bookst, CB.bookend, CB.userholid, CB.holbookid, CB.holtypeid, CB.deptid FROM holbook AS CB WHERE CB.userholid = '46' AND ((cb.bookst BETWEEN '20070101' AND '20071231') OR (cb.bookend BETWEEN '20070101' AND '20071231') OR (cb.bookst <= '20070101') AND (cb.bookend >= '20071231'))) AS CBB ON CC.holtypeid = CBB.holtypeid GROUP BY CC.holtypeid ORDER BY CC.holtypeid

if you have an idea of what i could try next please let me know
 
Have you tried posting the question in the ASP forum? Since you state that the SQL query works fine in MySQL, it's not a MySQL problem :)

Best of luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top