.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

Display Long Date Issue

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :Sql Server

I want to display my date as 15 October 2010. I am trying to use this:

=FormatDateTime(Today(), DateFormat.LongDate)

But am getting Friday, October 15, 2010. How can I format it properly?

View Complete Post

More Related Resource Links

ActiveX and Visual Basic: Enhance the Display of Long Text Strings in a Combobox or Listbox


The combobox and listbox controls in Visual Basic have no built-in support for displaying text strings that are too long to fit in the visible area of either control. This article describes several techniques to improve the readability of long strings in each control. The first technique uses tooltips to display a combobox or listbox item. The other techniques, which use various Windows APIs, include adding a horizontal scrollbar for a listbox and determining the necessary width of the longest string given the font attributes of the text. The required steps are described for both comboboxes and listboxes.

John Calvert

MSDN Magazine December 2000

Issue with date addition



I am using ASP.NET, C# 2.0.

I am having a date issue. The error is "Year, Month and Day parameters describe an un-representable Datetime"

I am adding the date with 14 and 7 depending on a condition.

Below is the code I have used:

DateTime d = DateTime.Now;
int addDays =0;

if (Convert.ToString(Session["School"]) == "US" )
addDays = 14;
addDays = 7;

DateTime n = new DateTime(d.Year, d.Month, d.Day + addDays);


 The issue happens, if the date is 17 for US Schools and 25 for other schools, if the month has 30 days. This issue will happen for 28 days in February, and 30,31 days for other months.

How to add this 14 and 7 depending on the months. I know i have to increment the month by 1 and increase the date to the next month( and increase year to next, if done in december). But not sure, how to do this.

How to add this?

Thank you

Deserialization issue with returned from web service

Hi, I have a VS 2008 C#  client using a proxy generated by the Service Reference tool from a schema for a (prob Java?) ASMX web service.  I got serialisation errors when I tried connecting to the service around<xs:date> date fields, and on inspecting the incoming XML discovered the date format was yyyy-mm-dd hh:mm:ss.sss.   So 2 questions really.. 1) Is the schema I've been supplied with incorrect? 2)Is there a way to work around this, apart from manually editing the schema to xs:datetime and regenerating the classes?   Thanks MJ

Display date as mm/dd/yyyy instead of yyyy-mm-dd

This should be a fairly simple question. On my performancepoint reports, I would like to return the date as 08/20/2010 as opposed to 2010-08-20. I tried to follow this guide, http://wills-blog.com/?p=93 , but it is outdated and does not seem to work in this situation. Could someone point me in the right direction?

Weird Date vs Date/Time issue using a calculated column

I'm attempting to use the fab 40 attendance template. I don't need the time to show - Im able to hide that on the forms with jquery (endusersharepoint.com thank you!!) I WAS ATTEMPTING to create a calculated column called Start Date where the formula simply reads '=[Start Time]' When it's set to display 'Date Only' the date is off by a day. If I switch it to 'Date & Time' I get the correct date. Huh?

i need to display a specific date on a condition

I am trying to display a specific date when a condition exists so i have this case statement but it does not work... ,CASE WHEN @ALTTYPE IN ('INCR','DECR','ADD','FLAG') THEN '09/09/99' ELSE END_DT END AS END_DT

VB.net issue when using dsoFramer to display Excel Worksheet

Hi to all, I'm using the dsoFramer control to display an Excel file , the problem is that suddenly it stops working fine and I'm receiving the following message. "Unable to display the inactive document.  Click here to reactivate the object" So I have to click on the Excel Sheet to start showing the information... that's awful for me and my tool users? anybody knows how can it be fixed. FYI, I use Visual Basic.net 2008 Express Edition

Date Time for Display

Hi AllI want to display time on Y axis and days on  x axis.I want to dispaly 12:00 AM,11:00 AM...11:59 PM.  on Y axis.I want function to create sequence like thatand on X axis display week like 6-sep,7-sep,..11-sep.can you give me the function for this.how i can create these

How to display the date only till current date in ajax calendar extender .

Hi,1) How can i display the date only till current date in ajax calendar extender ?2)How to validate the date in one TextBox with the Date in another TextBox ?    Please Help me ...

I want to display date field in y-axis of stacked bar, how?

select date   from   employee   now i want to show this date field in y-axis of stacked bar please tell me whats the procedure of doing this?

Sharepoint Workspace, name display issue



I was wondering if anyone else had seen this.  On my Sharepoint site, it properly shows my name associated with the content that I create in the form of Wildes, John.  When I connect my SharePoint Workspace software to the sharepoint sites I wish to work with, all the names have two (2) commas in them, as in  Wildes,, John

Why is this...? 



John Wildes | Senior Enterprise Architect | United Airlines | Desktop Engineering

WPF: how to change the ListView cell template if the content is too long, it will display as Charact


We have used the GridView inside the ListView. We fix the column width (see the following link):


if the content is too long in one cell (since we fix the column width), we want it display as CharacterEllipsis at the end

just like the TextBlock we can define TextTrimming="CharacterEllipsis"

how can we achive it?


we have used the ListViewItemStyle as following, can we modify the <GridViewRowPresenter  /> section to achive it?

  <!--ItemContainerStyle with the Trigger for selection x:Key="ListViewItemStyle"-->
  <Style x:Key="ListViewItemStyle" TargetType="{x:Type ListViewItem}">
   <Setter Property="Background" Value="Transparent"/>
   <Setter Property="HorizontalContentAlignment" Value="Center"/>
   <Setter Property="VerticalContentAlignment" Value="Center"/>
   <Setter Property="Foreground" Value="Black"/>
   <Setter Property="Margin" Value="5,0,5,0&q

Display latest date in GridView



           I m getting data from database using SQL

string mysql = "SELECT [ID],[FirstName],[LastName],,[MiddleInit],[DateLastModified] FROM [Databse] WHERE ([ID] = '54321') ORDER BY [DateLastModified]";

I have 4 rows for this sql and I m displaying in GridView. I want the latest modified date as my first row but it is displaying in a reverse order. How can I display rows using Latestmodified date without sorting.


incorect date value and formating on display form


On the list display form i have start date field which shows date in the folloving format : 2010-07-06T22:00:00Z

First it shows the wrong date since in edit from i see 7/7/2001

secondly the format is wrong since i choosen date only field so i don't want to see time and zone.

Does anybody knows why this happens and how to fix it?

Issue with CAML Query regarding date comparision.

I have a below query in one the eventhandlers. All I do in the query is to get all records where Next_Date column is < CurrentDateTime ( I have shown current date below in full date format but it will be variable).

What I am observing is the comparision seems to be failing or not considering time format. For example the below query should not return any records when NEXT_DATE is 9/30/2010 23:59:59 and CurrentDateTime is 9/30/2010 06:22:22. However the query does return records. It looks like the comparision is just happening with Date and not time. What could be the problem? Please suggest.

         <FieldRef Name='Next_x0020_Date' />
         <Value Type='DateTime'>2010-09-30T13:13:13Z</Value>
      <FieldRef Name='Next_x0020_Date' Ascending='False' />

Display date headers in SSRS reports


Hi All,

I have a report to display sales figure for the last 3 days including current date. That means whenever the report is generated it should start the date column with the current date and the previous 3 days data. I have the query ready to pull the data. But I am not able to generate the column headers in date format. Below is my report format for your reference...

  10/4/2010 10/3/2010 10/2/2010 10/1/2010
Product A

display only the date (not time) from a sqlserver date field in dynamic data


I have some Date fields defined in my sqlserver database but these display with a time part as well (00:00:00).

how do i esnure that only the date part is displayed and not this redundant time?


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