Solved

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

Posted on 2004-10-19
4
13,864 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now