Solved

DateDiff Function - European Dates

Posted on 2004-09-07
7
277 Views
Last Modified: 2006-11-17
Without changing the regional settings of a machine......

How can I compare 2 european dates without getting the number 31 by comparing '07/09/04' and  '08/09/04'

Thanks,
Aviva
0
Comment
Question by:avivak1
[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
  • 4
  • 3
7 Comments
 
LVL 7

Expert Comment

by:bluV11t
ID: 11996504
Try adding "Set dateformat dmy;" at the start of your sql-statement.
0
 

Author Comment

by:avivak1
ID: 11996517
let me rephrase..I'm using the DateDiff function
0
 

Author Comment

by:avivak1
ID: 11996522
and if i do change the regional settings would that change the Now() function to european date format?
0
Independent Software Vendors: 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!

 
LVL 7

Expert Comment

by:bluV11t
ID: 11996564
My mistake... I assumed you were using datediff in a database query.
0
 
LVL 7

Expert Comment

by:bluV11t
ID: 11996623
I'm quite sure changing regional settings would change Now() functions return to the format you specify.
0
 
LVL 7

Accepted Solution

by:
bluV11t earned 40 total points
ID: 11996732
You probably have to rearrange the dates yourself before comparing it, somthing like this...

day1 = datepart(d, '07/09/04')
month1= datepart(m, '07/09/04')
year1= datepart(y, '07/09/04')
date1=day1 & "/" & month1 & "/" & year1

day2 = datepart(d, '08/09/04')
month2= datepart(m, '08/09/04')
year2= datepart(y, '08/09/04')
date2=day2 & "/" & month2 & "/" & year2

difference = datediff(d, date1, date2)
0
 

Author Comment

by:avivak1
ID: 11996744
blah ok :)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

717 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