number of expired subscription

kigor

Registered User.
Local time
Today, 11:21
Joined
Apr 24, 2010
Messages
19
Hello,
I have list of subscriber with last number+year of subscribe.
I look now to find correct query formula to receive list of subscriber what expire when in input have period of time delimited by startnumber, startyear and endnumber and endyear

Little example.
If I have this subsriber (with last number and last year)
subscriber1 1 2010
subscriber2 8 2009
subscriber3 3 2010

And If I look period 10 of 2009 to 2 2010, I need to receive one subscirber
For period 7 of 2009 and 5 2010 I need to receive all 3

Note that number is not connected with month.
 
Is this "subscriber1 1 2010" from one field only?
If so, you will need to query and find the last 4 chrs on the right and find the chr 12 from the left.
Then you can do your query to return the result you are looking for.

If this is not the case then you should provide more data info.
 
This is from access help and may also help

About using wildcard characters to search for partial or matching values@import url(/Office.css);About using wildcard characters to search for partial or matching values

You use wildcard characters as placeholders for other characters when you are specifying a value you want to find and you:

  • Know only part of the value.
  • Want to find values that start with a specific letter or match a certain pattern.
In a Microsoft Access database, you can use the following characters in the Find and Replace dialog boxes, or in queries, commands, and expressions, to find such things as field values, records, or file names.
Character Usage Example * Matches any number of characters. It can be used as the first or last character in the character string. wh* finds what, white, and why ? Matches any single alphabetic character. B?ll finds ball, bell, and bill [ ] Matches any single character within the brackets. B[ae]ll finds ball and bell but not bill ! Matches any character not in the brackets. b[!ae]ll finds bill and bull but not bell - Matches any one of a range of characters. You must specify the range in ascending order (A to Z, not Z to A). b[a-c]d finds bad, bbd, and bcd # Matches any single numeric character. 1#3 finds 103, 113, 123
Notes

  • Wildcard characters are meant to be used with text data types, although you can sometimes use them successfully with other data types, such as dates, if you don't change the Regional Settings properties for these data types.
  • When using wildcard characters to search for an asterisk (*), question mark (?), number sign (#), opening bracket ([), or hyphen (-), you must enclose the item you're searching for in brackets. For example, to search for a question mark, type [?] in the Find dialog box. If you're searching for a hyphen and other characters simultaneously, place the hyphen before or after all the other characters inside the brackets. (However, if you have an exclamation point (!) after the opening bracket, place the hyphen after the exclamation point.) If you're searching for an exclamation point (!) or closing bracket (]), you don't need to enclose it in brackets.
  • You can't search for the opening and closing brackets ([ ]) together because Microsoft Access interprets this combination as a zero-length string. You must enclose the opening and closing brackets in brackets ([[ ]]).
  • A Microsoft Access project uses different wildcard characters than an Access database uses. For more information, search the Microsoft SQL Server Books Online index for "wildcard characters". If you're searching for values in any other data source, you may need to use different wildcard characters. Check the documentation for that data source for more information.
 
Far more complex that I initially thought but here it is:
See attachment
 

Attachments

To explain the above if you don't feel like downloading the file:

Add the following field to your query:
Add: [SubYear] & Right("0" & [SubNumber],2)

And search the following criteria on the field:
Between [Start Year] & Right("0" & [Start Num],2) And [End Year] & Right("0" & [End Num],2)
 

Users who are viewing this thread

Back
Top Bottom