A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

DateDiff function throwing error in Where clause



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old May 3rd, 2010, 07:04 PM posted to microsoft.public.access.queries
Petr Danes[_5_]
external usenet poster
 
Posts: 31
Default DateDiff function throwing error in Where clause

I have a set of queries that generate dates and want to use DateDiff to
select those records with certain dates are greater than others. The
following clause keeps giving me an incompatible data type error:

WHERE DateDiff('d',[From date],[DatumStvoreni])0

I have the exact expression in the SELECT clause and it show positive and
negative integers just fine, but when I add this test, I get the error.
There are no bad values in the dataset, I've looked, and when I export the
DateDiff column to a temp table and run a query on that, it works fine. Only
when I use the test directly with the DateDiff function does it bomb. I also
tried putting CDate() around the field expressions and it didn't help.

Pete



--
This e-mail address is fake, to keep spammers and their address harvesters
out of my hair. If you want to get in touch personally, I am 'pdanes' and I
use yahoo mail. But please use the newsgroup when possible, so that all may
benefit from the exchange of ideas.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:11 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Š2004-2024 OfficeFrustration.
The comments are property of their posters.