========== query example x1
--query1.sql.clear;
--query1.sql.add ('select tanggal, number , codecs, receivefrom from dbtanda');
--query1.sql.add (' where tanggal >= :xQTGL1 ');
--query1.sql.add (' and tanggal <= :xQTGL2 '); --query1.parambyname('xQTGL1').asDate := xTGL1 ; --query1.parambyname('xQTGL2').asDate := xTGL2 ; --query1.prepare; query1.open; --
========== query example x2
xquery1 := ' select tanggal, number , codecs, receivefrom, receiveis, '+ ' receiveno, curren, amount, dayback, receiveby from dbtanda ' ; query1.sql.clear; query1.sql.add ( xquery1 ); query1.sql.add (' where tanggal >= :xQTGL1 ');
query1.sql.add (' and tanggal <= :xQTGL2 '); query1.sql.add (' and number >= :xQnoInvo1 ');
query1.sql.add (' and number <= :xQnoInvo2 '); query1.sql.add (' and codecs = :xQnoCust1 ') ; query1.parambyname('xQnoInvo1').asString := trim(xnoInvo1) ; query1.parambyname('xQnoInvo2').asString := trim(xnoInvo2) ; query1.parambyname('xQNoCust1').asString := trim(xnoCust1) ; query1.parambyname('xQTGL1').asDate := xTGL1 ; query1.parambyname('xQTGL2').asDate := xTGL2 ; query1.prepare; query1.open;
========== query example x3
select CodeCS, curren, sum (amount) as tlAmount from dbtanda
group by CodeCs, Curren
order by CodeCs, Curren
0 comments:
Post a Comment