CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Searching by date SQL International format

Print topic Send  topic

Author Message
andash


Posts: 18
Posted: 01/04/2006, 7:17 PM

I have been down this path before with no luck. If I do eveything in US format ie mm/dd/yyyy then every thing works fine.. However not living in the states that aint going to work for us here (New Zealand).
I have set the project settings to dd/mm/yy or dd/mm/yyyy or even dd/mm/yy hh:mm:nn (as my ver of SQL stores dates and times) and I either keep on coming up with a date parsing error or no search results. If I try and search for an exact time and date match ie 05/01/2006 12:01:57 I get no results ( search criteria is equals) ... Im going round in circles here - any one been here done this before. Last time I got stuck with this I had to convert the date field to text and suffered the consequences just to get it going. If I had to have a guess I would say that the date format in the project settings is ignored when dates are passed. The moment I switch to a US type date format on the server (and that is a major mission in our production environment) the problem is gone.
Any one got any ideas?
Andrew
_________________
Andrew Asher
www.it3.co.nz
View profile  Send private message
peterr


Posts: 5971
Posted: 01/04/2006, 10:51 PM

Andrew,
Yes, the "Date Display Format" specified in project settings is ignored when working with dates at the database/SQL level. Those settings are used only for displaying dates in the format you want, for example in a label or textbox.
When working with databases you'd need to specify the proper date format for your database in CCS connection settings.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
andash


Posts: 18
Posted: 01/05/2006, 2:14 PM

Thanks, I have tried that (and in every concievable combination as well). I have a support call logged as well.
I was hoping some other international users might have struck this as well. The last project I did which had an entirely different environment I struck this as well. If I change the DB format to US style then I can do anything I could ever want with dates but in international format I have never had any luck with date searches. Both in CCS2 and now 3.
_________________
Andrew Asher
www.it3.co.nz
View profile  Send private message
peterr


Posts: 5971
Posted: 01/05/2006, 2:17 PM

Then possibly your database uses the US format for storing dates. In such case I wouldn't see anything wrong in setting the DB format to US date format. Only the date display should be set to your country's format.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
peterr


Posts: 5971
Posted: 01/05/2006, 2:25 PM

Also see:
http://www.devx.com/vb2themax/Tip/18619
"If you haven't localized SQL Server for your language, the default date format is the American one: DD/MM/YY."
I don't know anything about localizing SQL Server, but in case you haven't done that then you must specify American date format.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
andash


Posts: 18
Posted: 01/05/2006, 2:57 PM

Fixed, Unbelievable:
Although the SQL Database "displays" the data in dd/mm/yy hh:nn:ss it actually stores it in yyyy-mm-dd HH:nn:ss format. Go figure.
When I ran a query on a known date from SQL it returned this as it did the query - it does a date convert on the fly....
WHERE(SupportRequest_Date = CONVERT(DATETIME, '2006-01-06 10:34:03', 102))
A trap for not so young players. Thanks for your assistance
Andrew
_________________
Andrew Asher
www.it3.co.nz
View profile  Send private message
Benjamin Krajmalnik
Posted: 01/06/2006, 8:11 AM

Andash,

SQL Server is "smart" in that if you send the date portion as "yyyy-mm-dd"
it does not care what the stored format is and will convert internally.
I have my application running in various countries.
I have modified the classes slioghtly in that I have a configuration file
where I tell it whether the dates are mm/dd/yyyy or dd/mm/yyyy. My date
formatting functions look look at tis configuration setting and set the
"ShortDate" format accordingly.
I then, based on this, set the Session.LCID to a value which corresponds
with the date format. US dates are 1033, and I use the UK LCID for the
dd/mm/yyyy.

My applications are running in the US, Canada, Latin America, and Australia
without any problems.

kishroe kumar
Posted: 01/30/2006, 8:43 PM

:-)
i have a problem in jsp programming

form a html page i'm taking input date as 'dd-mm-yyyy'

how to conver to this input string into the date format

i tried to pase this input string but i falid to get in to the date format

plz any one will help me

thankq

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.