Hi guys,
Trying to pull a set of data from the database where member.join_date does not match up with a 'renewal month' attribute that they have on their record.
ie. if a member's join_date is 09/02/2010 their renewal attribute should be February.
My problem lies in that member.join_date is datetime
and attribute.attr_code_ref is and int and just a reference number to an attribute that is a certain month...see below
2079 JANUARY
2080 FEBRUARY
2081 MARCH
2082 APRIL
2083 MAY
2084 JUNE
2085 JULY
2086 AUGUST
2087 SEPTEMBER
2088 OCTOBER
2089 NOVEMBER
2090 DECEMBER
i think i need to set up a variable and use statements such as
and then later on use where clause of
however... this will work on a single month but i need the @month variable to be... well variable.
any ideas? (aplogies if none of the above makes sense...!)
cheers guys,
Dan
Trying to pull a set of data from the database where member.join_date does not match up with a 'renewal month' attribute that they have on their record.
ie. if a member's join_date is 09/02/2010 their renewal attribute should be February.
My problem lies in that member.join_date is datetime
and attribute.attr_code_ref is and int and just a reference number to an attribute that is a certain month...see below
2079 JANUARY
2080 FEBRUARY
2081 MARCH
2082 APRIL
2083 MAY
2084 JUNE
2085 JULY
2086 AUGUST
2087 SEPTEMBER
2088 OCTOBER
2089 NOVEMBER
2090 DECEMBER
i think i need to set up a variable and use statements such as
Code:
if a.attr_code_ref = 2083 set @month = 5
Code:
where month(member.join_date) != @month
however... this will work on a single month but i need the @month variable to be... well variable.
any ideas? (aplogies if none of the above makes sense...!)
cheers guys,
Dan