Hi, I am trying to write a query using SQL. I have two tables that are as below:
table miscdata contains: day, heatid
What I am trying to do is to get the number of heatids for a date range. I can get it to return the count of all the heatids for the range, but I need a row for each day in the range.
right now my query is:
SELECT count(heatid)
FROM miscdata
WHERE day = (SELECT DISTINCT day FROM dbo_MISCDATA WHERE day between day1 and day2);
It doesn't work, but that is kind of what I am trying to do.
If anyone has any suggestions I would be very appreciative. Sorry if the isnt very clear.
table miscdata contains: day, heatid
What I am trying to do is to get the number of heatids for a date range. I can get it to return the count of all the heatids for the range, but I need a row for each day in the range.
right now my query is:
SELECT count(heatid)
FROM miscdata
WHERE day = (SELECT DISTINCT day FROM dbo_MISCDATA WHERE day between day1 and day2);
It doesn't work, but that is kind of what I am trying to do.
If anyone has any suggestions I would be very appreciative. Sorry if the isnt very clear.