Micro Focus QTP (UFT) Forums
SQL Query Issue in QTP - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: SQL Query Issue in QTP (/Thread-SQL-Query-Issue-in-QTP)



SQL Query Issue in QTP - rajiv.qtp - 11-25-2013

Hello every one,

I am using the following Code -:

Code:
nowMonth=month(now)
nowDay=day(now)
nowYear=year(now)

TodayDate=nowYear&nowMonth&nowDay    
                StartDate=DateSerial(nowYear,nowMonth,nowDay-22)                                        StartMonth=month(StartDate)
StartDay=day(StartDate)
StartYear=year(StartDate)
                    NowStartDate=StartYear&StartMonth&StartDay      
                    
Dim kk
kk=20

And passing the following sql query -:
Code:
"select fromdomain, sum(total) as total,sum(delivered)as delivered,sum(bounced)as bounced,sum(readcount)as readcount,sum(replycount)as replycount,sum(unsub)as unsub from emailinfo where sdate1 >= '"+NowStartDate+"' and sdate1 <= '"+TodayDate+"' group by fromdomain order by fromdomain asc offset "+kk+" limit 20"

This query is causing the problem. If I pass offset 0 or 20 etc then query run perfectly but if I pass the offset value through a variable 'KK'. Its cuase problem.

Can anyone help here ?

Thanks in Advance !


RE: SQL Query Issue in QTP - Jay - 11-28-2013

please replace +kk+ to & kk & . should work