I have a query like this:
SELECT Sum([daudz]*[cena]*[reizinatajs]) AS Summa
FROM tpnos LEFT JOIN tap ON tpnos.npk = tap.nos
WHERE (((tap.dat)>=[apd1] And (tap.dat)<=[apd2]));
It runs nice, asking me apd1 and apd1, which is two dates.
All I want is, to create a form, where is a textbox with a date, let's call it tb_date, and a textbox, let's call it tb_sum, which uses the query. Dates apd1 and apd2 would be tb_date - 7 and tb_date - 1.
How can I make this? I put this SQL statement everywhere, but all I got is errors.
SELECT Sum([daudz]*[cena]*[reizinatajs]) AS Summa
FROM tpnos LEFT JOIN tap ON tpnos.npk = tap.nos
WHERE (((tap.dat)>=[apd1] And (tap.dat)<=[apd2]));
It runs nice, asking me apd1 and apd1, which is two dates.
All I want is, to create a form, where is a textbox with a date, let's call it tb_date, and a textbox, let's call it tb_sum, which uses the query. Dates apd1 and apd2 would be tb_date - 7 and tb_date - 1.
How can I make this? I put this SQL statement everywhere, but all I got is errors.