• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

DateDiff Function - European Dates

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
avivak1
Asked:
avivak1
  • 4
  • 3
1 Solution
 
bluV11tCommented:
Try adding "Set dateformat dmy;" at the start of your sql-statement.
0
 
avivak1Author Commented:
let me rephrase..I'm using the DateDiff function
0
 
avivak1Author Commented:
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!

 
bluV11tCommented:
My mistake... I assumed you were using datediff in a database query.
0
 
bluV11tCommented:
I'm quite sure changing regional settings would change Now() functions return to the format you specify.
0
 
bluV11tCommented:
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
 
avivak1Author Commented:
blah ok :)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now