Solved

UK DateFormat

Posted on 2006-06-29
3
312 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

821 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