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  

find a date within a range of dates



 
 
Thread Tools Display Modes
  #1  
Old October 27th, 2008, 02:18 PM posted to microsoft.public.access.queries
Gab
external usenet poster
 
Posts: 6
Default find a date within a range of dates

hi i'm trying to find a date within a range and i'm using this expression
IIF([createdDate] in [InvoiceDate]-60,ā€Yā€,ā€Nā€)
the creation date should be within invoice date - 60 days.
am i using the expression correctly?
It seems to ignore the -60 days window
Thanks for your help

  #2  
Old October 27th, 2008, 03:04 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default find a date within a range of dates

am i using the expression correctly?
Yep.
I think this is what you want. In design view --
Field: createdDate
Criteria: Between [InvoiceDate] And [InvoiceDate]-60
--
KARL DEWEY
Build a little - Test a little


  #3  
Old October 27th, 2008, 04:11 PM posted to microsoft.public.access.queries
Marshall Barton
external usenet poster
 
Posts: 5,361
Default find a date within a range of dates

Gab wrote:

hi i'm trying to find a date within a range and i'm using this expression
IIF([createdDate] in [InvoiceDate]-60,”Y”,”N”)
the creation date should be within invoice date - 60 days.
am i using the expression correctly?



The IN operator works differently from what you apparently
think it does. Try something more like:

IIf(createdDate Between DateAdd("d", -60, InvoiceDate) And
InvoiceDate), ”Y”, ”N”)

Since I have no idea what you mean by "find a date", this
whole discussion could be going down a fruitless path.

--
Marsh
MVP [MS Access]
 




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 02:46 AM.


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