Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

UK DateFormat

Posted on 2006-06-29
3
Medium Priority
?
317 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 6

Accepted Solution

by:
e1v earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

670 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