CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> Archive -> GotoCode Archive

 CCS/Access/ASP European date problem

Print topic Send  topic

Author Message
Jeff
Posted: 04/19/2003, 2:26 AM

I have the following setup:

CCS 2.0.5.6
MS Access database
ASP
Win 2000 web server based in United Kingdom

Dates in Access are set to Short Date (dd/mm/yyyy) from drop-down list (not custom).
Format in CCS is set to dd/mm/yyyy from the drop-down list.
DBformat in CCS is set to dd/mm/yyyy HH:nn.ss from the drop-down list.
Project Settings Date Display Format is set to dd/mm/yyyy HH:nn.ss from the drop-down list.

Despite all this, if I enter dates in dd/mm/yyyy format, they are stored and in mm/dd/yyyy format. Is there anything I can do to overcome this problem?
Edd
Posted: 04/20/2003, 2:23 AM

Jeff,

Address the issue from a greater perspective what you have is a typical US environment when you use ASP.

To get around it try the following:

1. Leave the project as DD/MM/YYYY format as you have done.

2. In the header, set the regional location code for where you are, for the UK it is 2057, ie add the code:

Session.LCID = 2057

( 3081 for Austalia (where I am), 5129 for NZ, etc)

3. Set the dates to Short Date, General date or whatever. Do not use DD/MM/YYYY unless you have a really good reason.

4. Ensure that your SQL connection is set to MS Access.

Try it on one page and I think you will find it should work.

Hope this helps.

Edd
Jeff
Posted: 04/21/2003, 12:13 AM

Thanks for the response, Edd. I haven't been able to get your solution to work, but perhaps I am placing that line of code in the wrong place. Can you be more specific, for the benefit of a non-programmer, about which section of the code I should place the line in. For exmple, I tried it in the 'Page Class_Initialize Event' and in 'Initialize Method' sections on my Header page and in 'Initialize Page' on the actual record page. I also tried it in the 'Initialize Common Variables' section of common.asp. All to no effect.

Session.LCID is reasonably well covered in the forum for CodeCharge but not for CodeCharge Studio.

Yours in hope,

Jeff
Jeff
Posted: 04/21/2003, 2:14 AM

As a follow-on to my last posting, a web search suggests:

Place following into the top of each ASP page you wish to change the locale settings on: -

<%
'Set the server locale
Session.LCID = 2057
%>

but it just generates an error:

Error Type:
Microsoft VBScript compilation (0x800A0400)
Expected statement
Common.asp, line 2
Option Explicit

Any ideas?
NaSTy
Posted: 04/22/2003, 7:29 AM

Hi,
i'm from Italy ..
I have the same date problem!
I have partially resolved mixing the dates format (DB, CCS, ASP)..
I try now the solution from Edd.
Thanks

Jeff let me know if you have resolved!
Nailara
Posted: 04/23/2003, 2:07 PM

I had the same problem with MSSQL 2K.

Use Format: dd.mm.yyyy or some other one
Use DB-Format yyyy-mm-dd hh:nn:ss

Remove the datepicker. I think that these object has a problem with non-english date format.
Jeff
Posted: 04/24/2003, 3:52 AM

Well, I finally got it working, thanks to various clues from all you folk, some additional help from the CC support staff - and a final bit of inspiration from myself.

First, most advice included bits of the following:

1. Don't set any specific date format within MS Access itself.

2. Don't set any date format in the Data Format Property for the field.

3. Set the Data DBformat property to yyyy-mm-dd HH:nn:ss

4. Set the Date Display Format in Project Setting to whatever you want (I used dd/mm/yyyy).

4. In Project Settings/Connections/Modify Connection/Server, make sure your date setting is the same as above, i.e., yyyy-mm-dd HH:nn:ss (that oversight appears to have been my biggest error).

5. Set the Session.LCID to your required country. To do this, you need to open the Properties window for the entire project by selecting the project name in the Project Explore window. This gives you a property called Locale Identifier. Select your country from the list box. The result will display in hex (e.g., the LCID for the UK is 2057, which displays as 809 in hex).

Good luck!
Dunkie
Posted: 04/29/2003, 8:00 AM

Hi folks!

Could anyone be having some insight into why MSSQL2000 causes CCS2056 to have problems with date searches? especially when searching for say a month or just a date (e.g. 3, 17, 20) and not a full date (e.g. 20/04/2003). My date settings are all dd/mm/yyyy in the format for CCS, DB and Project.

Any help given will be most appreciated!

Regards,
Dunkie
Edd
Posted: 04/30/2003, 4:39 PM

Dunkie,
Not sure what your parameters are for asking a Day (all dates where Day = 1) etc but the problem will be in the SQL generated (bloddy obvious).

In the BeforeEcexuteSelect event Add the following do display what the is going on to the screen, i.e.
Response.Write YourDataSource.SQL & "<HR>"
Response.Write YourDataSource.Where & "<HR>"
This should give you a clue.

If all else fails then what I was taught was "if you write code outside of the USA then the safest method of comparing dates is to convert it to strings". This has saved my ass a thousand time, i.e. use the convert method in SQL to resolve what you need.

Hope this helps :-)
Edd
Dunkie
Posted: 05/02/2003, 10:20 AM

Hi Edd!

Thanks a heap for your tips!

Lemmie try them out and tell you what goes... I've been waiting for help from CCS support but none seems forthcoming....

Cheers!
Dunkie
Dunkie
Posted: 05/03/2003, 9:58 AM

Hi Edd!

Thanks for your tips but I have 1/2 bad news! The Response.write suggestion is pretty fine, but it doesn't do anything after putting a value to search.

I've taken your 2nd piece of advice albeit very late. I've opted to convert all my tables to views whose "dates" are actually plain text as per your advice and it's working fine.

Many thanks for that tip but I hope someone out there could really give me a SQL fix.

Cheers!
Dunkie

   


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

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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