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

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

Multiple date formats in pipeline......

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :Sql Server
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

View Complete Post

More Related Resource Links

SQL Server Date Formats

One of the most frequently asked questions in SQL Server forums is how to format a datetime value or column into a specific date format. Here's a summary of the different date formats that come standard in SQL Server as part of the CONVERT function. Following the standard date formats are some extended date formats that are often asked by SQL Server developers.

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 multiple date


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

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.

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

regex for diffrent date time formats


Every date time format can  be represented by a regular expression 

how can i get the a regular expression for a perticulat format?

using .net API

Localization of date formats in .NET\Windows


We are in the process of regionalizing an application, in this effort we want dates to conform to a given regions format sub BG "d/MM/yyyy". We have implemented this using resources\culturinfo in our application. We use the resource to hold the format we need to retrieve for a given region. The backend we're using is SQL server 2008. One of the concerns we had was, even though we're displaying dates in a given format such as "d/MM/yyyy", our system still writes that data from the controls we're using in the application as "MM/dd/yyyy", this is something we want to happen, and all is great. Also literature states that SQL server logins determine the format of dates when connecting to SQL server for data updates and inserts. Since our login will have its language set to US-English, we appear to be fine. Testing of this model on a system by changing the regional settings does not affect the model in place.  My question is, with this type of model in place where the date format is driven by embedded resource (resx) files and the SQL login using US-English, are there any other machine environment setting\variables (OS or .NET framework) to consider that can cause grief? I can provide any information is needed to make my questio

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.

Multiple Column Dropdownlist for the ASP.NET DataGrid

Based on my previous control "Multiple Column DropDownList for ASP.NET", I received many emails asking for the same control to be used in the DataGrid for web applications. Here we go.. This control can be used as the regular MS DropDownList in the DataGrid and also as a regular dropdownlist. It has all the properties, like DataTextField, DataValueField, DataSource, SelectedIndex etc. The download file contains the samples both in VB.NET and C#. In this sample, I have used the Northwind database of SQL Server.
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