Hi There,
I've recently come across a problem with a query I'm trying to get results out of.
Here's the situation:
I have a table called 'ProductsChild', which just stores information about Books such as: ReleaseDate, ISBN Number, etc.
I need to know if a specific book is a 'New Release'. A new release is a book that has not been published yet (Release Date) and is still a new release after 1 month of it being published already.
I used this query:
SELECT *
FROM ProductsChild pc INNER JOIN
ProductsParent pp ON pc.ProductsParentID = pp.ID
WHERE (MONTH(pc.ReleaseDate) >= MONTH(GETDATE()) - 1) AND (YEAR(pc.ReleaseDate) >= YEAR(GETDATE()))
I need to join these 2 tables because I require information from both of them on my front end application.
The problem is that any book that is to be released in a future year, doesn't get returned.
Please help if you can, thanks.

Date Dillema!
Maverickcoder
You guys have been a great help, I appreciate it alot.
Thanks to all,
Daniel Minnaar
PaulB1950
http://msdn.microsoft.com/library/default.asp url=/library/en-us/tsqlref/ts_fa-fz_2c1f.asp
Xllerator
big_j
SELECT *
FROM ProductsChild pc
INNER JOIN ProductsParent pp ON pc.ProductsParentID = pp.ID
WHERE
(
pc.ReleaseDate >= DATEADD(M, -1, GETDATE())
OR pc.ReleaseDate IS NULL
)