DateDiff issue

Copper Contributor

Funktion in a query:  Minutes: DateDiff("n",[TimeIn],[TimeOut])

Dont work and I can really not see whats wrong.

Any sugestions?

9 Replies

@ToreSweden What does it mean to say "Don't work"?

 

What DOES happen? An error? The wrong result? Nothing?

 

We can't help unless we know what is wrong. 

Well, the error msg saying the syntax is invalid.
Thats it.
Should also tell that i am using an Swedish version off Access.
But what i can see is the function spelling the same.

@ToreSweden 

That syntax itself appears to be valid, so there are a couple of additional things to verify.

 

First, I believe the delimiter should be the same in both versions, i.e. "n" 

However, it may be that in your version it could be the single quote, 'n'

That seems unlikely, but we ought to check every possibility.

 

The more likely problem, though is how it is used in the query. Can you open the query in SQL View and copy the entire SQL statement and paste it here? 

I just did find out that in the Swedish version the comma´s is exchanged to semicolon´s

Problem solved.
Thanks anyway.

Tore
Really. I am not surprised it is different, but the semi-colon ; definitely does surprise me:
Minutes: DateDiff(;n;,[TimeIn],[TimeOut])
No, its the comma´s, to be changed like: Minutes: DateDiff("n";[TimeIn];[TimeOut])

Tore
Ouch. That, I believe, is the dumbest thing I've said in weeks. Sorry.
LOL... ;)