×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

asp.net + crystal reports: problem with date fields query

asp.net + crystal reports: problem with date fields query

asp.net + crystal reports: problem with date fields query

(OP)
Hi,
I'm having an issue with a webapplication and can't seem to trace the error since the results are different on my laptop and on a windows server.

Info is stored into an access database (accdb), including a field "mydate", type date/time - short date format.
The regional settings of my laptop and another machine (win server) are: "Belgium" / "Dutch" / shortdate format = "d/MM/yyyy" (settings in the control panel)

An ASP.net page shows a search form, including a datepicker (using the CalendarExtender from the Ajax control toolkit). The results of the search are shown in a crystal report.

Test on my laptop (correct results)
search for records where mydate = 10/03/2014 --> shows the crystal report with the correct results, mydate is shown as 10/03/2014 (71 pages)
search for records where mydate = 3/10/2014 --> shows the crystal report with the correct results, mydate is shown as 3/10/2014 (2 pages - I added some records with this date for testing purpose)


same test on the server -> results are switched:
search for records where mydate = 10/03/2014 --> shows the crystal report with results 3/10/2014: mydate is shown as 3/10/2014 (2 pages)
search for records where mydate = 3/10/2014 --> shows the crystal report with results 10/03/2014: mydate is shown as 10/03/2014 (71 pages)


So, on the server the day and month seem to switch in the search query (I guess). However, I have no idea why since the code is exactly the same on both machines...
In the web.config file, there's nothing to overrule the regional settings... On my laptop, I can open the access file to check the values and they seem ok. On the server, access isn't installed, so I cannot check if the date is into another format there.


RE: asp.net + crystal reports: problem with date fields query

Your regional settings are incorrect on your web server. This could either be the default for the server or a user account account on the server.

RE: asp.net + crystal reports: problem with date fields query

(OP)
I logged on to the server with the same account as the webapplication was installed.
The regional settings are the same as on my laptop. But, is it possible that the default regional settings are different than the current settings displayed?

RE: asp.net + crystal reports: problem with date fields query

Yes you need to ensure that the regional settings are cascaded down to all users on the server

RE: asp.net + crystal reports: problem with date fields query

(OP)
keayfjgn, thanks for the help.
I logged on to the server again, went to the regional settings in the control panel (short date was still correct), but used the administrative tab to copy the settings to the welcome screen and new user accounts.
After the necessary reboot it seems ok.

But I still don't understand why... The user account I used to connet to the server had already the correct regional settings. The webapplication was installed under this user account, and the webapp is accessed using http://localhost/.... Or is this site accessed using the network (or asp.net) user account maybe?

Anyway, thanks again. This will already help me in future projects too.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close