Ok, So I have these two tables -
BioUser- UserId,Weight,DateAdded
DimDate-Date // It has basically all the dates for any period..its basically a table with all dates till 2050
Now the BioUser table has entries for weight of a user but not for everyday but whenever they enter their weight. So I want to basically build a list of values for date and weight for all those missing dates in the BioUser. To explain myself better here is an example -
BioUser -
UserId Weight DateAdded
1 178 10/12/2009
1 175 10/18/2009
1 172 10/27/2009
So when I am trying to build a list between two dates say 10/12/2009 to 10/30/2009. It should display a list like -
Weight Date
178 10/12/2009
178 10/13/2009
178 10/14/2009
178 10/15/2009
178 10/16/2009
178 10/17/2009
175 10/18/2009
175 10/19/2009
175 10/20/2009
175 10/21/2009
175 10/22/2009
175 10/23/2009
175 10/24/2009
175 10/25/2009
175 10/26/2009
172 10/27/2009
172 10/28/2009
172 10/29/2009
172 10/30/2009
I have query something like this -
Select Weight,DateAdded from BioUser join Dimdate on BioUser.DateAdded=Dimdate.Date
But the above does not work somehow I want to get the most recent entry on weight from BioUser and only one entry also as the BioUser table can have multiple entries for a day.Can anyone please help me out ..