.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

Passing Date Paramaters (Convert(Char(10, ,DATE,110))

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :Sql Server

I need to pass in user friendly date paramaters for values but I'm not sure how to display the converted dates in the stored porcedure that I'm passing frienldy dates to  do i need to do a converert everywhere that i have a date field?

and where around the dateadd columns?


@MINDT datetime
					,@MAXDT datetime
					,@EM_ITEM_NUM CHAR(7)
WITH itmlvl AS (




	, rb.DSCR
	, rp.AMT
	, rp.EFF_DT
	, splr.EM_ITEM_NUM

FROM geprs_dnc..T_REBATE rb 
		JOIN geprs_dnc..T_REBATE_PERIOD rp 

View Complete Post

More Related Resource Links

How to convert Date format from dd/MM/yyyy to mm/dd/yyyy in asp.net



         I am using a text box which captures the date from the datepicker and displays in dd/MM/yyyy format in asp.net using C#

When i try to pass this text box value into the DatTime variable i am getting the error as

"String was not recognized as a valid DateTime. "


my code goes like this

DateTime dt;




i tried to use Conver.ToDateTime() function but the same error is croping up..


Can any one plz suggest me on this.....Thnks in advance

Convert Update Date/Time to VB.NET



I was wondering if someone could convert this into VB.NET for me.  I'm not a PHP pro and not entirely sure what's happening here nor do I know how to get this to display the same way.

The new field is within a DetailsView, so you can give me example code as well, I'll greatly appreciate it.

Thanks.. -Jeff

PHP Code:

function updFormat($tStamp) {
	$tsTime = (strftime('%I', $tStamp) + 0) . strftime(':%M %p', $tStamp);
	// 86400 == # of seconds in a day
	$tsDays = floor($tStamp / 86400);
	$nowDays = floor(time() / 86400);
	if ($tsDays == $nowDays) $updTime = "Today at $tsTime";
	elseif ($tsDays == $nowDays - 1) $updTime = "Yesterday at $tsTime";
	else $updTime = strftime('%b ', $tStamp) . (strftime('%d', $tStamp) + 0) . strftime(', %Y' , $tStamp);

	return $updTime;
<asp:DetailsView ID="dtv_LastUpdated" runat="server" Width="100%" 
    AutoGenerateRows="False" DataSourceID="ods_MVPParcelUpdate" 
    CellPadding="1" CellSpacing="1" GridLines="None">
        <asp:BoundField DataField="Update_time" HeaderText="Parcel Data:" 

how can i convert Persian date to c# date time?

hi all how can i convert Persian date to c# date time? Persian Date like 1388/01/20 Thanks Motevallizadeh

Convert a string (from xml) into date time

Is there a simple command to take this string: 2010-09-09T17:00:00.000Z and turn it into a date time? It is a date time value that is passed to us in an xml document, it has a type of 'unitless', when I read it I need to set a dateTime variable to this date and tim, I can parse it, but perhaps there is a simple single command that is already written for just such a thing. Thanks. 

Need to convert query string(date - 09/15/2010) to a text format - yyyymmdd

I am fairly new to C # and need some assistance with a form page.  I have created a simple form that requires the user to select a beginning date and ending date.  I then pass the values to my code behind page via query strings.  I have them passing, but I need the format to be change to a different format.  Unfortunately the database does not use the standard date format.  It requires the date to be in a text format as YYYYMMDD.Form: <tr> <td> Beginning Date:</td> <td><asp:TextBox runat="server" ID="begDate"></asp:TextBox> <asp:Image ID="Image2" ImageUrl="~/images/calendar_schedulehs.png" runat="server" /></td> </tr> Code Behind: protected void createReport_Click(object sender, EventArgs e) { StringBuilder url = new StringBuilder("Report/TopCustomer.aspx?"); url.Append("BegDate=" + begDate.Text); url.Append("&EndDate=" + endDate.Text); url.Append("&Brnch=" + ddlLocation.SelectedValue); Response.Redirect(url.ToString()); Current URL: TopCustomer.aspx?BegDate=09/15/2010&EndDate=09/30/2010&Brnch=300I need to have the above URL change to:TopCustomer.aspx?BegDate=20100915&E

convert date to mmddyy format before submit to database

Dear all,   Could anyone pls guide me on how to convert date in textbox which is in format(dd/mm/yy) to mmddyy before submit to database.    

Convert Remedy ARSystem Date in SQL Server to short date format

Hi: Does anyone know how to convert Remedy ARSystem Date in SQL Server to short date format compensating for EST and Daylight savings. Thank you in advance!

How to Date function convert (09/13/2010 10:18:24 to 13.Sep.10)

 How to Date function convert (09/13/2010 10:18:24  to     13.Sep.10)passing a simple query no template used input  09/13/2010 10:18:24output 13.Sep.10

how to jquery date convert to Timestamp


how to jquery date convert to  Timestamp

convert string into date of birth



was just wondering what is the best way of creating date of birth string from the a text like "980123-09-5623", I only need the first 6 digits..to be convereted to date of birth, for example -- 98 represents the year..1998, 09 represents September and 23 represents the date.

hmm..it looks so complicated..can it be done using calculated services..can I do something like this..get the string and store it in a date field in a form like..23-01-98(separated by -)...then..i can get another calculated field with a date format such as...23 January 1998



Convert date in dd.mm.yyyy


Date on the page is displayed in the format mm.dd.yyyy, how to convert it to be displayed in the format  dd.mm.yyyy.

This is the code from the site:


whether it be something like this  <%# Convert. ??????  Eval("newsDate")%> 


add column to gridview to convert date


can I add a column to gridview that will convert the utc date to my local time?  HOw? 

Convert Date (dd-MM-YYYY) to (dd/MM/YYYY)


Dear Sir,

In my DB, there is 5000 date values are stored like "DD-MM-YYYY" Format in nvarchar datatype. For Example 18-10-2010

And when i convert into date format for the following purpose.

"Select * from tbl_master order by Convert(datetime,date_of_Appln,103)"

Its not working.

Can you help me to convert? or Can you help me to replace the "-" symbol to "/"?

Thanks in advance.



SSIS - Passing a date parameter to a SQL Query question again....


I need to pass a date string to my sqlcommand inside of my "datareader source".  I read some of the questions about setting expression variables but I can't seem to figure out how to do it.  I pasted the query below.  The table name contains a date in it so I need to pass that date as a string into my sqlcommand at runtime.  Do I create a variable with the entire SQL command in it or can I just create a single variable that holds the date and just reference that in my datasource reader sqlcommand property?  Can someone assist me with the syntax for creating the expression?

     pages_20101006.`date` AS full_date,
     pages_20101006.`cat` AS category_no,

Thanks very much,



how to convert date type in SQL query output ?


In my database when anyone registers - By default the registration time is saved as UTC universal time zone.

But i want to display everything on the website in (GMT-05:00) Eastern Time (US & Canada)

I am using this SQL QUERY to display registration date:

SELECT TOP (5) Username, CustomerID,  RegistrationDate = CONVERT(VARCHAR(12),RegistrationDate,107)  FROM Customer ORDER BY RegistrationDate DESC

And, i am displaying it like this:

<asp:Label ID="nameLabeldate" runat="server" Text='<%# Eval("RegistrationDate") %>' />

The problem is the output is getting displayed as : 10/20/2010 1:36:01 PM

I know RegistrationDate is datetime stamp that's why i am getting output in this format.

But i want to display RegistrationDate as: Oct 20, 2010 at 1:36pm -> according to (GMT-05:00) Eastern Time (US & Canada) ORDER BY RegistrationDate in Desc (top most will be last registered user)

I need help with sql query by which i should be able to accoplish my desired output..please help...

convert date from YYYYMM to date for comparison


I have a column char(6) that I need to use as a date for comparison.

My YR_Month is the 6 char string that I need to use like this







Date Covertion from Char field to a proper format


Hi Gurus,

There is a field in a table with type and length as varchar(255).  It stores a value as follows 'Patch_Test_9_10_201012;00;00AM'.  I need to extract 9_10_201012;00;00AM and format it as 9/10/2010 12:00:00 AM.  I tried CONVERT and CONVERT+CAST it won't work.

Is there a way to do it? Please, any ideas , inputs are wellcome


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