Solved

UK DateFormat

Posted on 2006-06-29
3
311 Views
Last Modified: 2010-04-16

it seems no matter what I try I cannot return correct date values from my select statement, fo example I have a calender
control which the user selects the date then click a button to run

string startdate = string.Format("#{0:dd/MM/yyyy}#", Calendar1.SelectedDate);
select....WHERE ([dbx].[Arrival Date]= " + startdate + ")";

so i select 01/07/06 but returns 07/01/06

..help
0
Comment
Question by:ziwez0
3 Comments
 
LVL 6

Accepted Solution

by:
e1v earned 500 total points
ID: 17008508
You must either change your startdate string to MM/dd/yyyy or change the dateformat on the database with
set dateformat dmy
before the select
0
 
LVL 2

Expert Comment

by:Anandavally_P
ID: 17008574
Hi,
I am getting it in the correct it in the correct format. I tried the same code that you have specified. I dont think you have any problem with your SelectedDate statement.

Thanks,
Anandavally P
0
 
LVL 2

Author Comment

by:ziwez0
ID: 17009010
e1v that did the job, (MM/dd/yyyy) so does that mean the db is setup in US Format?
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

Suggested Solutions

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 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

18 Experts available now in Live!

Get 1:1 Help Now