Solved

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

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 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

9 Experts available now in Live!

Get 1:1 Help Now