Hi,
I have this query for MySQL:
SELECT @m:=(
SELECT COUNT(cardid)
FROM `transactions`
WHERE
operation>=1000 AND
operation<2000 AND
date<:beginDate
);
SELECT
@m:=@m+1 AS 'id',
t.date,
o.name,
t.amount
FROM `transactions` AS t
INNER JOIN `operations` AS o ON t.operation=o.id
WHERE
operation>=1000 && operation<2000 AND
date>=:beginDate AND
date<=:endDate
ORDER BY date;
SELECT @m:=(
SELECT COUNT(cardid)
FROM `transactions`
WHERE
operation>=1000 AND
operation<2000 AND
date<:beginDate
);
SELECT
@m:=@m+1 AS 'id',
t.date,
o.name,
t.amount
FROM `transactions` AS t
INNER JOIN `operations` AS o ON t.operation=o.id
WHERE
operation>=1000 && operation<2000 AND
date>=:beginDate AND
date<=:endDate
ORDER BY date;
To copy to clipboard, switch view to plain text mode
And I try to execute it with QSqlQuery and it returns error. I prepare and bind the values for :beginDate and :endDate before executing it.
Can't be used querys with vars from QSqlQuery?
Bookmarks