.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

rendering today's date through DVWP and modifying the XSLT

Posted By:      Posted Date: August 30, 2010    Points: 0   Category :SharePoint
I need the Current date or Today to do some simple calculations(calculated columns) such as this: =IF(AND([Due Date]< [today], [today] < ”[Due Date]”),”Red”, “Green”) Question is: To can I convert the above formula so that it works in XSL modifying the XSLT. I new at this and not sure about the syntax. Can anyone help? I am thinking it would be something like this: <xsl:choose> <xsl:when test="ddwrt:Today() &gt; @DueDate"> <xsl:text>Red</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>Green</xsl:text> </xsl:otherwise> </xsl:choose> Obviously something is wrong with the code above...i don't get anything in return.   Thanks Cnothing for members to see

View Complete Post

More Related Resource Links

Getting records that 7 days pass today's date


I want to get all records that are 7 days pass today's date and not equal to today's date.  Don't know how to write it so I can get records 7 days old but with this procedure I'm still getting records that are due today.  Hope this makes sense.  Can someone assist me.

select * from libraryrequest
where  duedate > getdate() and duedate != getdate()

Workflow SPD: Set Today Date+Time to Column-field




I have a little question about settings specific today (Date + Time) value to a field/column within a workflow that is designed by Sharepoint Designer 2007.


I can manage to set the field to today() => but the time is always 00:00 houres.

I would like to set a specific field to the "exact" date+time when the workflow is running. (so choosing a fixed date+fixed Time isn't a solution either)


So I anyone could help me how I can do such "simple" task, I would be very pleased.






Today's date Sharepoint column formula

How do I access the today's date in a column formula in Sharpoint List.  The TODAY function doesn't work in calculated columns values.

DVWP $Today ignores site timezone setting?


Hi. I am using the data view web part to help format list items by comparing a custom date column to the current date. I get the current date by using the $Today parameter that is set by the data view web part from a CAMLVariable parameter.

I have set the site's timezone to GMT so I was expecting $Today to come back as GMT. But it is not, $Today is coming back using the server's timezone which is PST. The problem is, we don't have access to the server so we can't change the timezone. Also, because the $Today date is coming back in PST it means it's impossible to compare it to the dates in the list items which are coming back in GMT.

Has anyone had this problem?

Myles Jeffery | Thinkscape | SharePoint Online Deployment | SharePoint Online File Migration Tool

dynamic table rendering in XSLT


I'm sure this problem has been worked out many times before, but my experience with XSLT apparently isn't good enough to allow me to see how to do the following: 
say the XML looks something like this:

  <location>New Jersey</location>
  <name>book signing</name>
  <location>New York</location>

I need my XSLT to render a table that looks like:

(this part is easy.  I know the XML will always render two values here)

  <th>book signing</th>

(here's where it gets tricky and where I lose grasp of how to get what I want. - not all
elements have values, and  it needs to be dynamic - I want, in the case of this example,
the book signing location to render at the cell in the top righ

SQL Server throws exception converting today's date based on Arabic(Umm al Qura calendar) to Gregor



My application has support for Arabic and I'm relying on sql server to convert dates from Arabic calendar to Gregorian calendar and vice versa.

The Arabic calendar is based on the lunar sighting and there is a possible difference of 1-2 days.

The country in which my application is deployed uses the Umm Al Qura Arabic calendar(Saudi Arabia, Makkah) and according to it today is 30th of Rabi Al-Thani 1432 A.H. or simply 30/04/1432.

When the query is run to convert today's date (In Arabic) to today's Gregorian Date, SQl Server throws an exception (since SQL server uses the Kuwaiti algo for converting dates).

You can try it out using the following query:

Arabic to Gregorian throws an error (for today's date)

SELECT CONVERT(datetime, '30/04/1432 10:14:41:000AM', 131)

Gregorian to Arabic returns a tomorrow's date

SELECT Convert(nchar, GetDate(), 131)


Is there a work araound for it in SQL Server 2005 Compact Edition?


The .NET compact framework does not support the UmAlQuraCalendar class either,

so this link http://blogs.ms

how to set default date like [Today] for sp2010, Report Builder 3.0

tried to enter the filter parameter for a date field as [Today], or today() etc. neither works in either Report builder3.0 or sharepoint 2010(after the report uploaded to sharepoint, then subscribe the report)

Using a CompareValidator to check input is a valid date

The CompareValidator can do more than just compare two controls. You can also compare it against several of the main .net data types such as Date, Integer, Double and Currency.

To do this you would set Operator="DataTypeCheck" and instead of setting the ControlToCompare or ValueToCompare attributes as you normally would you use the Type="Date" (or any of the data types I have listed above).

How To Set a Date Format In GridView Using ASP.NET 2.0

A very common desire is to set a column of a gridview to display just the month, day and year of a DateTime type. The problem is the by default, the HtmlEncode property of the boundfield attribute (
The problem is that if this field is enabled, you can not pass format information to the boundfield control. That is, if you try the following code, you will not get the desired result.

jQuery Date picker Implementation in ASP.NET

I've posted a wrapper ASP.NET around the jQuery.UI Datepickercontrol. This small client side calendar control is compact, looks nice and is very easy to use and I've added it some time back to my control library.

This is primarily an update for the jQuery.ui version, and so I spend a few hours or so cleaning it up which wasn't as easy as it could have been since the API has changed quite drastically from Marc's original implementation. The biggest changes have to do with the theming integration and the resulting explosion of related resources.

If you want to use this component you can check it out a sample and the code here:

How to format datetime & date with century?

Execute the following Microsoft SQL Server T-SQL datetime, date and time formatting scripts in Management Studio Query Editor to demonstrate the usage of the multitude of temporal data formats available and the application of date / datetime functions.


Date and Time Functions in SQLSERVER

Date and time functions allow you to manipulate columns and variables with DATETIME and SMALLDATETIME data types.

1 DATEPART Function
2 DATENAME Function
3 DAY, MONTH, and YEAR Functions
5 DATEADD Functions
6 DATEDIFF Function
7 More SQL Server Functions

Data Types - Date and Time in SqlServer

Date and time values can be stored with either the DATETIME or SMALLDATETIME data type. The difference between the two is that SMALLDATETIME supports a smaller range of dates and does not give the same level of precision when accounting for time. The DATETIME data type can hold values from January 1st of 1753 to December 31st of 9999. The time is stored to the 1 three hundredths of a second and each value takes up 8 bytes of storage. The SMALLDATETIME data type can hold values between January 1st 1900 and June 6th of 2079. The time is tracked to the minute and each value takes up 4 bytes of storage. The majority of business applications can live happily with SMALLDATETIME, however, if you are in an environment where each second matters or you need to make estimates to the distant future (or past) then you have to resort to DATETIME. If you fail to specify the time when inserting a value into a DATETIME or SMALLDATETIME column, a default of midnight is used. If you fail to specify the date portion the default of January 1, 1900 is used.

Rendering ASP.NET Script References into the Html Header

One thing that I've come to appreciate in control development in ASP.NET that use JavaScript is the ability to have more control over script and script include placement than ASP.NET provides natively. Specifically in ASP.NET you can use either the ClientScriptManager or ScriptManager to embed scripts and script references into pages via code.

Built-in Functions - Date and Time Functions

Date and time functions allow you to manipulate columns and variables with DATETIME and SMALLDATETIME data types.

Essential SQL Server Date, Time and DateTime Functions

The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any formatting considerations at all.

Date/Time Conversions Using SQL Server

There are many instances when dates and times don't show up at your doorstep in the format you'd like it to be, nor does the output of a query fit the needs of the people viewing it. One option is to format the data in the application itself. Another option is to use the built-in functions SQL Server provides to format the date string for you.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend