hello gents,

after a while of successless searching I post this thread now:

Maybe this problem belongs also to the ASP-Area because I have problems with an SQL-Statement only when I try to use it in an classic asp-page. here some code:

Code:
<%@ Language=VBScript %>
<%Option explicit%>
<%
Response.Expires = 0
Response.AddHeader "Pragma", "No-Cache"
Response.CacheControl = "no-cache"

//Dates
Dim MonthMinus0, MonthPlus1
MonthMinus0 = DateDiff("s","1970/1/1",DateSerial(Year(now()),Month(now()),1))
MonthPlus1  = DateDiff("s","1970/1/1",DateAdd("M", 1, DateSerial(Year(now()),Month(now()),1)))

Dim adocon, adors
set adocon = Server.CreateObject("ADODB.Connection")
set adors = Server.CreateObject("ADODB.RecordSet")

adocon.open Application("DbConnection")

Dim SQL
SQL = "SELECT SUM(CASE WHEN CRM5.SALE.SALEDATE between " & MonthMinus0 & " AND " & MonthPlus1 & " THEN CRM5.SALE.AMOUNT ELSE 0 END) AS SUMMARY FROM CRM5.SALE WHERE CRM5.SALE.ASSOCIATE_ID=502"
Response.Write(SQL & "<br> <br>")

adors.open SQL, adocon, 0, 1

adors.close
set adors = nothing

//Close database for now...
adocon.close
set adocon = nothing
%>
the result is that:
Code:
SELECT SUM(CASE WHEN CRM5.SALE.SALEDATE between 1230768000 AND 1233446400 THEN CRM5.SALE.AMOUNT ELSE 0 END) AS SUMMARY FROM CRM5.SALE WHERE CRM5.SALE.ASSOCIATE_ID=502

OraOLEDB error '80040e14' 

ORA-00972: identifier is too long 

?, line 0
when I let run this sql-statement in oracle sql*plus worksheet I don't get an error. it works fine there.

but why not in my asp? has it to do something with the ADODB?

thanks for your reply.

ren้