SharePoint CQWP: How to use today's date to compare to another field
November 15, 2009 4:38 PM Subscribe
SharePoint CQWP: How on earth can I use today's date to compare to another field in a calculated column or filter in SharePoint?
posted by momzilla to Computers & Internet (1 answer total) 1 user marked this as a favorite
(WSS 3.0, MOSS 2007) We have two subsites that have announcements lists which we are using to display deadlines. We are using the Content Query Web Part on the parent site homepage to roll up the deadlines from both subsites. Project manager only wants deadlines that will be expiring within the next seven days to display in the CQWP. This seemed like an easy task to complete ... just use the filter in the CQWP. However, I cannot figure out how to get it to allow for [Expires]-7 or otherwise use Today, Date or Now functions in a calculation.
My first solution was to create a calculated column to determine the beginning date to display the deadline (using the formula of [Expires]-7). The column displays fine in the list, but I wasn't able to get this to work in the CQWP filter because it didn't see this calculated column as a date field, even though I selected "Date" data type when I created it.
My second attempt was to try to create a "countdown" of days until [Expires], wherein I ran into the Today function limitation in calculated fields.
Am I going about this the wrong way or overlooking the obvious? What is the easiest way to achieve this? I'm new to SharePoint, and any guidance is appreciated.