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

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

sort multiple date

Posted By:      Posted Date: September 20, 2010    Points: 0   Category :ASP.Net

Hi all,

i read the data from the rows, at some row cells has multiple date's. im reading these date and stored into an Array, after that i tried to Sort at that time im getting the error as "Microsoft JScript runtime error: Number expected"

actually this is my sort method code

function compareAscName(a, b)

case 'DOB':
                    var dateA = new Date(a.DOB);
                    var dateB = new Date(b.DOB);
                    return dateB - dateA;

this is the code im calling above code

dataInputArray.sort(compareAscName); when the system reach this code with multiple date in a array parameter then above method not called.

if a = "09/07/2010~10/01/2010" and b= "09/08/2010~10/02/2010" then this time only im getting error,

if a = "09/07/2010" and b= "09/08/2010" then this time its working fine. i knew some thing i have to do on

View Complete Post

More Related Resource Links

Is it possible to use multiple date fields to have an event show more than once on a Sharepoint 2007

Hello, Is it possible to use multiple sets of start and end times to have events display multiple times in a sharepoint calendar? To clarify: - I have the standard fields of "Start Time" and "End Time" in my calendar list. - Events show on the calendar just fine. - Would like to create additional fields called "Start Time 2" and "End Time 2" within the same record and have the event show multiple times on the calendar. - The recurrence functionality of sharepoint will not meet my needs because the pattern I need to use is not in one of the allowed choices. Thanks in advance, John

Sort WSS 3.0 Calendar by Start Date

I have read a few posts about people not being able to sort by start date on the calendar.  Was wondering if anyone has this figured out to sort by start date correctly with re-occuring appointments?  I have a code snippet from another post but do not know how to format it correctly as I am a new sharepoint user.  If someone can help with that that is also appreciated.  Thanks.  Code Below:  I basically have no idea to find the info requested below <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script> //today's date var today = new Date(); //get the Date var myDate = today.getDate(); //get the Month var myMonth = today.getMonth()+1; //get the Year var myYear=today.getYear(); //put date into a mm/dd/yyyy format var myDate = myMonth + "/" + myDate + "/" + myYear; //If this is on a webparts page, get the WP div id.  If it's on a list page, you don't need the webzone div ID. //Get the table and table class (usually it's .listviewtable, but if you've customized a webpart, sometimes it's .ms-summarycustombody.  //I used Todd Bleeker's "Style Under Cursor WebPart" to find the CSS class. $(function(){ $('div#WebPartWPQ3 table.ms-listviewtable tr:not(:contains("' + myDate 

select top row for multiple entry for a date in table


My current query is

select  Date= createdon , Total=count(*) from ReportDetail where 
reportid = 9 and (CreatedOn BETWEEN '07/01/2010' AND '09/30/2010') 
group by  createdon
order by createdon desc

return data like

2010-09-21 09:36:46.493    112
2010-09-21 08:33:12.667    114
2010-09-21 07:45:20.830    176
2010-09-21 07:33:34.340    114
2010-09-20 07:27:43.753    125
2010-09-17 10:04:27.120    75
2010-09-16 11:50:05.777    52

What I am looking for

2010-09-21 09:36:46.493    112
2010-09-17 10:04:27.120    75
2010-09-16 11:50:05.777    52

Basically for 9/21, I want to get only one latest row. Please advice.

Sort WPF Datagrid using multiple columns



Is it possible to sort a WPF datagrid using more than one column ?



Multiple date formats in pipeline......

I have a large record set that contains several date columns.  The date formats are MMYY,  YYMMDD.  and YMMDD (integer format).  My requirements require that the above mentioned formats of these dates need to formatted to that of YYYYMMDD.  In addition it also a requirement that the MMYY date format be either the first of the month of last day of the month.  What would be an efficient method of processing?  Multiple data flows to handle each format?  One data flow utilizing a lookup to a calendar table?  How would I handle if needed to add other date columns into the record set at a later time.
SQL - new guy

Multiple companies and fiscal calendars in date dimension table

We are creating an application where different companies can have their own fiscal calendar starting on different dates. For example one company’s fiscal year may start in April and some others in Sep. Also fiscal calendars may start at any date. (E.g. 29 Sept).

These fiscal calendars would be created for parent companies. We have added the parent company ids to the date dimension table. Please suggest the correct way of setting the attribute relationship in the above scenario. If this is not the right method to do this, please suggest the correct design approach for achieving this.


Thanks in advance,


Hamlin Stephen

How to sort a TEXT Date Column ?


I have data :- 31-May-07

Its in a calculated column of the list. The method I used to get it :- =IF(FDate="","",TEXT(FDate,"dd-mmm-yy")) {FDate is a DateTime type of column. The returned value is stored in a "Single Line of Text" column type.}

I am now unable to sort that column as its Text now and sorting is done on basis of strings.

I need to sort this column on basis of Date.

Any help ?


how to sort date dimension in SSAS 2008?


Hi I have SSAS 2008 DimDate dimension.

At source DimDate table has:
DateID : 20100518 (primary key), 20100519, 20100520,... (and SortKey too at T-SQL level)
MonthName : April, May, June,....
MonthNameYear : April,2010  May,2010  June,2010

I would like to sort dimension by MonthNameYear's attributes (currently I have order like January 2001, January 2002, January 2003.... but I want order like January 2001, Feburary,2001,March,2001 .......)
In SSAS visual studio, in Date dimension structure >> Attributes panr>> Month Name Year (properties : OrderBy, I set to Key, Name, AttributeKey, AttributeName and deployed but no luck in sorting).

Any idea how to sort date dimesion attributes? Thanks.

InfoPath 2007 display date for multiple time zones



We have an InfoPath 2007 form integrated with SharePoint 2007 and uses Web Service as Data Sources. The end users are located in multiple time zones in US and Australia. The server is located in US Eastern time zone. We would like the form to display user's local date and time.

The return of web service shows correct local date and time, except the time zone keeps at -04:00. For example during the one hour after midnight Eastern Time, the web services return:

Eastern: 2011-04-13T00:04:03.793537-04:00

Central: 2011-04-12T23:04:15.5734594-04:00

Mountain: 2011-04-12T22:04:24.3693642-04:00

Eastern Australia: 2011-04-13T15:04:18.8366836-04:00

When I preview the form it shows correct date, but after uploading it to SharePoint and view in web browser, the date is off by one day (either ahead or behind).

My looked at this post http://social.msdn.microsoft.com/forums/en-US/sharepointdevelopment/thread/677c03e4-8d71-43b3-aff9-1b6662a2528a but I don't get how it display different dates in different timezones by using UTC.

How can I make sure the form ignores the server time or the time zone indicated in the web service return, and just display the date as it is?



Multiple database support with Entity Framework

One of the features introduced in Entity Framework is being database independent. Which mean each database provider can support Entity Framework by implementing its provider.

This feature allows you build applications independent from the underplaying database provider. In this post I'm going to show how to build an application that support multiple databases using same conceptual model made by Entity Framework.

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).

Binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Here is the code for binding the multiple drop down boxes in GridView using JQuery in ASP.NET

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.

Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

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:

Adding Multiple Columns and Rows in GridView without using a Database

This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.

GridView Multiple Filter AJAX Control

This AJAX control enables the user to filter data within any column inside a GridView. The user can add multiple filters and can delete existing ones too.
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