Solved

DateDiff Function - European Dates

Posted on 2004-09-07
7
276 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
Technology Partners: 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

Title # Comments Views Activity
wordpress display sub menu only when click 12 92
Writing comments on <p></P> or paragraph 2 23
edit .asp files 5 60
window close link 7 62
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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

737 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