A
anil
Hi all
i have written query using alias table to get results of parameter for
last 12 months which is as follows:
SELECT t.Town, t.AMonth, t.Ayear, t.ParameterName, t.SAMPLE_NO,
t.RESULT,
DateDiff("m",DateSerial(t.AYear,t.Amonth,1),DateSerial([Table1].[Ayear],[Table1].[Amonth],1))
AS DiffMonths
FROM table1 AS t
WHERE
(((DateDiff("m",DateSerial([t].[AYear],[t].[AMonth],1),DateSerial([Table1].[AYear],[Table1].[AMonth],1)))
Between 0 And 11))
ORDER BY t.RESULT;
in this query AMonth and AYear are month and year of sample date.
So the problem is when I run the query it always ask for Table1.Ayear
and Table1.AMonth, although I have connected table1 year and month to
form which works fine as indiviual.Can I fix it so that I can directly
select Table1.Ayear and table1.Amonth from the form when it is open.OR
finally directly select this query in form.
thanks
anil
i have written query using alias table to get results of parameter for
last 12 months which is as follows:
SELECT t.Town, t.AMonth, t.Ayear, t.ParameterName, t.SAMPLE_NO,
t.RESULT,
DateDiff("m",DateSerial(t.AYear,t.Amonth,1),DateSerial([Table1].[Ayear],[Table1].[Amonth],1))
AS DiffMonths
FROM table1 AS t
WHERE
(((DateDiff("m",DateSerial([t].[AYear],[t].[AMonth],1),DateSerial([Table1].[AYear],[Table1].[AMonth],1)))
Between 0 And 11))
ORDER BY t.RESULT;
in this query AMonth and AYear are month and year of sample date.
So the problem is when I run the query it always ask for Table1.Ayear
and Table1.AMonth, although I have connected table1 year and month to
form which works fine as indiviual.Can I fix it so that I can directly
select Table1.Ayear and table1.Amonth from the form when it is open.OR
finally directly select this query in form.
thanks
anil