ID - int
Period - int
Created -datetime
+ ett antal ointressanta fält till
Jag vill genom att skicka in t ex 2005-01-01(dvs januari 2005) få ut alla vars datum(Created) matchar med Perioden på 2005-01
t ex Period: 3 och Created: 2004-07 blir 2005-01(men även 2004-10, 2005-04), Period: 24 och Created: 2003-01 blir 2005-01 osv.
SELECT ID,ProductID,AccountNamesID,UserID,ServerID,Article,Name,
Description,Period,Qty,Price,Created,Ended
FROM ServiceItems
WHERE Period <> 0
AND UserID = @userid
AND DATEDIFF(mm, Created, @month) % period = 0