CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> ASP

 CCParseDate function help please

Print topic Send  topic

Author Message
jerrym

Posts: 52
Posted: 02/11/2009, 2:18 PM

hey guys

i'm hoping someone can help me with this problem.

i have a Before Show event on a listbox with its datasource set to a table containing weekly StartDates & EndDates. the properties of the listbox are; its bound to StartDate and Text column set to EndDate.

the application works in an XP Pro test machine however when deployed to a win2003 machine the page would not even load throwing an error as below;

Common Functions. CCParseDate Function error '800a0fa1'

Unable to parse the date value.

has anyone encountered such a problem before?
View profile  Send private message
jerrym

Posts: 52
Posted: 02/11/2009, 4:49 PM

in my testing this is what i discovered. i commented out the custom code in before show of listbox just to see what the listbox showed in terms of the dates.

on XP pro machine the listbox showed dates in m/d/yyy format
on win2003 machine the listbox showed dates in d/m/yyyy format

under what circumstances can this happen? i.e. different machines showing dates with different formats. greatly appreciate your comments and help.
View profile  Send private message
TimG

Posts: 1
Posted: 02/11/2009, 7:27 PM

There is a function to set the date/time format in the control panel on Windows, under administrator functions. Maybe someone on the Win2K+3 server changed it's format. Maybe if you change your format to match the server this will help fix the issue.
View profile  Send private message
jerrym

Posts: 52
Posted: 02/11/2009, 7:37 PM

Hi timG

nup, i checked the server's regional settings and they are set according to our region which is Australia>Perth and ofcourse i double checked my desktop's regional settings as well.
View profile  Send private message
Chris__T


Posts: 339
Posted: 02/12/2009, 6:00 AM

Did you check the date settings in your project settings in CCS itself? If you have CCS running on two different machines, the projects could have different date/time setup
View profile  Send private message
jerrym

Posts: 52
Posted: 02/12/2009, 6:14 AM

Hi Chris_T

yes i double checked the locales settings as well. the date format in locales matches the regional settings on my desktop & the server regional settings. and No CCS is not installed on server.
View profile  Send private message
jjrjr1


Posts: 942
Posted: 02/12/2009, 6:24 AM

Hi

Just a thought.

Since listbox data is stored in the database, Check the format that dates are stored in the database. Maybe each machine has a different date format in the DB.

Also on the listbox properties be sure the date format is set for both the CCS display and DB format

That's all I can think of at this time.

Have fun

_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
jerrym

Posts: 52
Posted: 02/12/2009, 6:39 AM

There are no date format options to set for a listbox unlike a textbox.

the sql server column is of type datetime, when i open the table the dates are shown as d/m/yyyy BUT i think its stored differently as yyyy-mm-dd etc etc
View profile  Send private message
jjrjr1


Posts: 942
Posted: 02/12/2009, 6:59 AM

Hi Jerry

I am at a loss.

There are only a few places that date format can be set.

1. Project settings under locales, you said you checked here.
2. In the actual databse connection in project settings under the server tab
3. In the properties for a control itself.

You are right, list boxes have differnt property arangement.. In a list box one would assume the data type for the control is the bound value.

I still think the problem is somehow DB related. What values are in the text colomn vs the bound colomn.

Also consider CCparsedate takes a string value not a date value. If your bound value is datetime CCParsedate will not work since a datetime value is usualloy an integer.

Not really inderstanding what you are trying to do and what your DB looks like it is a little hard to say at this time. Try exploring what the function Date returns on each server.

I am not really familiar with ASP but just thought I would add my 2 cents and hopefully help.

Have fun
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
jerrym

Posts: 52
Posted: 02/12/2009, 2:05 PM

Quote :
I still think the problem is somehow DB related. What values are in the text colomn vs the bound colomn.

The text column and bound column are both datetime values except 1 is for startdate the other for EndDate. long story with these but initially we wanted Startdates so some SP's were written based on startdates then it got changed to EndDates, so to make life easy for me instead of rewriting some SP's all i did was get the user to pick EndDates but bound the startdates for a timesheet app.

the bound column is not an issue here as it works i.e. inserts into SQL Server fine. my issue here is if i use the code below;

tmp = CCParseDate(Timesheet.PeriodStartDate.ItemsList(i), array("d", "/", "m", "/", "yyyy"))

it'll work on the server BUT not on my desktop. to have it work on my desktop i have to change the code to;

tmp = CCParseDate(Timesheet.PeriodStartDate.ItemsList(i), array("m", "/", "d", "/", "yyyy"))

note the positions of 'm' & 'd'

Quote :
2. In the actual databse connection in project settings under the server tab
in CCS this is the format for the date yyyy-mm-dd HH:nn:ss

any help is much appreciated.
View profile  Send private message
jjrjr1


Posts: 942
Posted: 02/12/2009, 3:24 PM

Hmm Jerry.

I understrand now what you are doing.

What you have described above indicates that the text value for your listbox is physically stored differently on each server.

A couple of things I would check. Since your bound colomn is working and is stored as datetime all is well there. But the text colomn should probably not be of the type date time. for a couple of reasons I can think of. First CCS expects this to be text type data and second so does CCParsedate.

With that being said, have you tried setting the datatype of the text colomn in the database to text and place the the date into that field as "mm/dd/yyyy". This might cause your text date format to always match the mask used for CCParsedate.

Let me know if that is a help.

Having fun yet?? :-)

_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
jerrym

Posts: 52
Posted: 02/12/2009, 6:51 PM

I will give your suggestion a try.

in the mean time i've also successfully used vbscript's FormatDateTime function instead of CCParseDate. this has worked in both XP Pro and on the server without changing any data types in sql server.
View profile  Send private message
jjrjr1


Posts: 942
Posted: 02/13/2009, 8:15 AM

Hey Jerry

Sounds like a solution is close at hand.

Let me know what you find. I would be curious.


_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
Oper


Posts: 1195
Posted: 02/13/2009, 1:05 PM

Deleted - Sorry info on your inbox
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message

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.

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.