ardy
Registered User.
- Local time
- Yesterday, 23:58
- Joined
- Sep 24, 2012
- Messages
- 98
Hello All:
I am having a heck of a time figuring this out…..
. I Think there needs to be a conditional statement to the nearest date to the 15th day of the month. Most of date statement I have found are between and math driven(add subtract etc...). I have table with bunch of wells, divided into two types Monthly and Quarterly, each well has several reads spanning over time(time series). I need to a query that can make a new table with all the reads that fall on or closest to the 15th of each month. The kicker is that I need only one read if the type is Quarterly for each 3 months(the quarter) and 1 read for each month if the type is monthly(total of 3 read for the quarter). Can somebody help me on this? The example below is kind of showing this ……
Well_Num, Type, Read, Date
Well1, Monthly, 10.2, 1/1/2013
Well1, Monthly, 10.2, 1/2/2013
Well1, Monthly, 10.1, 1/20/2013
Well1, Monthly, 10.3, 2/10/2013
Well1, Monthly, 10.3, 2/16/2013
Well1, Monthly, 10.3, 3/1/2013
Well1, Monthly, 10.3, 3/15/2013
Well2, Quarterly, 9.1, 1/1/2013
Well2, Quarterly, 9.2, 1/5/2013
Well2, Quarterly,9.1, 2/2/2013
Well2, Quarterly,9.1, 2/15/2013
Well2, Quarterly,9.1, 3/2/2013
Well2, Quarterly,9.1, 3/18/2013
The resulting Table from the query should be
Well_Num, Type, Read, Date
Well1, Monthly, 10.1, 1/20/2013
Well1, Monthly, 10.3, 2/16/2013
Well1, Monthly, 10.3, 3/15/2013
Well2, Quarterly,9.1, 2/15/2013
Is this possible to achieve with Create Table Query. maybe it would be easier if I devide the query in several queries? any help is appricuiated
I am having a heck of a time figuring this out…..

Well_Num, Type, Read, Date
Well1, Monthly, 10.2, 1/1/2013
Well1, Monthly, 10.2, 1/2/2013
Well1, Monthly, 10.1, 1/20/2013
Well1, Monthly, 10.3, 2/10/2013
Well1, Monthly, 10.3, 2/16/2013
Well1, Monthly, 10.3, 3/1/2013
Well1, Monthly, 10.3, 3/15/2013
Well2, Quarterly, 9.1, 1/1/2013
Well2, Quarterly, 9.2, 1/5/2013
Well2, Quarterly,9.1, 2/2/2013
Well2, Quarterly,9.1, 2/15/2013
Well2, Quarterly,9.1, 3/2/2013
Well2, Quarterly,9.1, 3/18/2013
The resulting Table from the query should be
Well_Num, Type, Read, Date
Well1, Monthly, 10.1, 1/20/2013
Well1, Monthly, 10.3, 2/16/2013
Well1, Monthly, 10.3, 3/15/2013
Well2, Quarterly,9.1, 2/15/2013
Is this possible to achieve with Create Table Query. maybe it would be easier if I devide the query in several queries? any help is appricuiated