Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Today's date Query View modes: 
User avatar
Member
Member
steffanwoodhead-hotmail - 11/16/2010 7:06:35 AM
   
Today's date Query
I am trying to do a "Thought for the day"
I have set up a custom table with 2 fields - the thought, and the date it should appear.
I am trying to use a "custom table datalist" with a query in the content filter "WHERE condition" to just show the relevant day, but I can't get it to work.

Any ideas? I am not a programer - just a maths teacher trying to do a school website

User avatar
Member
Member
steffanwoodhead-hotmail - 11/16/2010 1:50:48 PM
   
RE:Today's date Query
I think I've sussed it (well I asked someone in work)

Datepart(dd,getdate()) = Datepart(dd,ThoughtDate) and Datepart(mm,getdate()) = Datepart(mm,ThoughtDate)

If I use the above, I can get away with leaving them on next year as they will still work because the year is ignored.

I could also use Datepart(dy,getdate()) as it gives a value from 1 to 365 and I can match it with an index in the table