Date Ranges (1 Viewer)

Shadowrun

New member
Local time
Today, 10:56
Joined
Sep 20, 2017
Messages
1
Hi,

So I have an issue (Obviously) and was hoping I could get some suggestions on how to approach it.

I have a set of data with unique items within unique sets.

For example if I sold 10 units in Group A on 11/30/2016 I would want it to be assigned to item AB because it falls between 9/1/2016 & 1/1/2017.

I'm wanting to calculate the following in an access query via a function (I assume) and don't know the best way to approach it.

"https://ibb.co/hMKO3k"
 

Peter Reid

Registered User.
Local time
Today, 16:56
Joined
Dec 3, 2003
Messages
134
Assuming the data in the linked image is in a table called Table1, the following will give you what you want for the example given.

Code:
DFirst("Item","Table1","[Group]='A' AND [Date]>#11/30/2016# AND [Calc]<#11/30/2016#")

Add in an equal sign where appropriate, eg what happens if a Group A item was sold on 01/05/2017, does it have item AC or AD?

There are better ways to achieve want you want but then there are better ways to store your data!
 

Users who are viewing this thread

Top Bottom