Solved

ALTER SESSION SET NLS_DATE_FORMAT="DD-MM-YYYY";

Posted on 2004-10-19
4
13,875 Views
Last Modified: 2010-05-18
ALTER SESSION SET NLS_DATE_FORMAT="DD-MM-YYYY";

i HAVE TO DO THIS IN ORDER FOR THE BELOW TO WORK IN ASP.NET

EVERY TIME.

IS THERE A WORK AROUND.

      select_statement += " Where To_Date(RC_DATE, 'dd-mm-yyyy') <= '" + DateString2.ToString() + "' And To_Date(RC_DATE, 'dd-mm-yyyy') >= '" + DateString1.ToString() + "'";
                        


0
Comment
Question by:mathieu_cupryk
  • 2
4 Comments
 
LVL 10

Expert Comment

by:jnhorst
ID: 12355345
Mathieu:

What is "DateString2"?

If you have a control that has a DateTime value, you can do this:

DateTimeValue.ToString("dd-MM-yyyy")

to format the date.  Make sure you cap the "MM", as the lower case "m" means "minute"; the upper case "M" means "month"

John
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 12356390
I suggest you to look a the CultureInfo class provided by the .Net framework whcih is used by the HttpContext.CurrentCulture and CurrentUICulture. By setting the correct culture you can change the way datetime objects are shown on the screen. The easiest way would be by setting the correct property in the web.config.

For example:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="nl-NL" uiCulture="nl-NL" />
 </system.web>
</configuration>

Look at the properties culture and uiCulture.

CJ.
0
 
LVL 22

Accepted Solution

by:
CJ_S earned 500 total points
ID: 12356402
... culture you can change the way datetime objects are shown on the screen ...

should be

... culture you can change the way datetime objects are shown on the screen and how they are used within your system.

However, when you are talking with a database you might have to always work with american date format (mm-dd-yyyy).
0
 

Author Comment

by:mathieu_cupryk
ID: 12376585
Excellent
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ASP.net VB.net Errors when sending data to SQL 5 20
What namespace do I need to import? 2 26
ASP.net Fit 3 divs on screen side by side 3 25
List<PaisEntity> - show some 1 24
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question