Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

DateDiff Function - European Dates

Posted on 2004-09-07
7
Medium Priority
?
289 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 160 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

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!

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

636 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