Hi:
Can you please tell me how do I do the following:
I have a text field [dealno]; the maximum lenght for it is 9.
ie:DEALNO Pair Matured Leg 1
FX05875 P Yes
FX05876 P Yes
FX05877A Yes
FX05878B Yes
FX05879 P Yes
FX05879X P Yes L 1
The ones that are the same until X are 'pairs' and have P in Pair field; How
do I get not P for the others??
On the same note how do put L 2 in Leg field for the on with no X??
Below is my criteria that does not work 100%:
Pair: IIf(Right([dealno],1)="X","P",IIf(Mid([dealno],8,1) Not In
("A","B","X",Not Null),IIf(Left([dealno],8)<>"FX????X?","P")))
/****
Leg 1: IIf(Right([dealno],1)="X","L 1")
THANKS A LOT!!!
Dan
|
|
0
|
|
|
|
Reply
|
Utf
|
1/23/2008 7:34:01 PM |
|
Somehow I don't see that your sample data matches the criteria you have
posted.
How are the first two items in your list the same? FX05875 and FX05876
match up to the last character.
Would you care to try to state in words what how record 1 and 2 are a pair?
And how the last two records are a pair? And why the middle two aren't a
pair?
Leg 1: IIf(Right([dealno],1)="X","L 1","L 2") puts L 1 where the last char
in DealNo is an X and L 2 in all other cases.
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
"D" <D@discussions.microsoft.com> wrote in message
news:87B789BF-F891-4A78-9CCD-0F0C396124C3@microsoft.com...
> Hi:
>
> Can you please tell me how do I do the following:
>
> I have a text field [dealno]; the maximum lenght for it is 9.
> ie:DEALNO Pair Matured Leg 1
> FX05875 P Yes
> FX05876 P Yes
> FX05877A Yes
> FX05878B Yes
> FX05879 P Yes
> FX05879X P Yes L 1
>
> The ones that are the same until X are 'pairs' and have P in Pair field;
> How
> do I get not P for the others??
> On the same note how do put L 2 in Leg field for the on with no X??
>
> Below is my criteria that does not work 100%:
>
> Pair: IIf(Right([dealno],1)="X","P",IIf(Mid([dealno],8,1) Not In
> ("A","B","X",Not Null),IIf(Left([dealno],8)<>"FX????X?","P")))
>
> /****
>
> Leg 1: IIf(Right([dealno],1)="X","L 1")
>
> THANKS A LOT!!!
>
> Dan
>
|
|
0
|
|
|
|
Reply
|
John
|
1/23/2008 8:06:25 PM
|
|
Hi John:
Thank you!
The records that are "pairs= because up to X are the same chars." are the
ones that until X have the same characters: FX05879 and FX05879X - all the
pairs are one with x and one without.
The P for the first two is there because my condition did not work; sorry!
The middle two are not pairs because do not have X and are different.
Thanks again,
Dan
"John Spencer" wrote:
> Somehow I don't see that your sample data matches the criteria you have
> posted.
>
> How are the first two items in your list the same? FX05875 and FX05876
> match up to the last character.
>
> Would you care to try to state in words what how record 1 and 2 are a pair?
> And how the last two records are a pair? And why the middle two aren't a
> pair?
>
> Leg 1: IIf(Right([dealno],1)="X","L 1","L 2") puts L 1 where the last char
> in DealNo is an X and L 2 in all other cases.
>
>
>
> --
> John Spencer
> Access MVP 2002-2005, 2007-2008
> Center for Health Program Development and Management
> University of Maryland Baltimore County
> ..
>
> "D" <D@discussions.microsoft.com> wrote in message
> news:87B789BF-F891-4A78-9CCD-0F0C396124C3@microsoft.com...
> > Hi:
> >
> > Can you please tell me how do I do the following:
> >
> > I have a text field [dealno]; the maximum lenght for it is 9.
> > ie:DEALNO Pair Matured Leg 1
> > FX05875 P Yes
> > FX05876 P Yes
> > FX05877A Yes
> > FX05878B Yes
> > FX05879 P Yes
> > FX05879X P Yes L 1
> >
> > The ones that are the same until X are 'pairs' and have P in Pair field;
> > How
> > do I get not P for the others??
> > On the same note how do put L 2 in Leg field for the on with no X??
> >
> > Below is my criteria that does not work 100%:
> >
> > Pair: IIf(Right([dealno],1)="X","P",IIf(Mid([dealno],8,1) Not In
> > ("A","B","X",Not Null),IIf(Left([dealno],8)<>"FX????X?","P")))
> >
> > /****
> >
> > Leg 1: IIf(Right([dealno],1)="X","L 1")
> >
> > THANKS A LOT!!!
> >
> > Dan
> >
>
>
>
|
|
0
|
|
|
|
Reply
|
Utf
|
1/23/2008 8:46:03 PM
|
|
On Wed, 23 Jan 2008 11:34:01 -0800, D <D@discussions.microsoft.com> wrote:
>Hi:
>
>Can you please tell me how do I do the following:
>
>I have a text field [dealno]; the maximum lenght for it is 9.
>ie:DEALNO Pair Matured Leg 1
>FX05875 P Yes
>FX05876 P Yes
>FX05877A Yes
>FX05878B Yes
>FX05879 P Yes
>FX05879X P Yes L 1
>
>The ones that are the same until X are 'pairs' and have P in Pair field; How
>do I get not P for the others??
>On the same note how do put L 2 in Leg field for the on with no X??
>
>Below is my criteria that does not work 100%:
>
>Pair: IIf(Right([dealno],1)="X","P",IIf(Mid([dealno],8,1) Not In
>("A","B","X",Not Null),IIf(Left([dealno],8)<>"FX????X?","P")))
>
>/****
>
>Leg 1: IIf(Right([dealno],1)="X","L 1")
>
>THANKS A LOT!!!
>
>Dan
You may be able to find these pairs with a SELF JOIN query:
SELECT A.DEALNO, B.DEALNO
FROM yourtable AS A INNER JOIN yourtable AS B
ON B.DEALNO = A.DEALNO & "X";
This query will find all pairs (triples, quads, quints...) where one record
has a given dealno value and the other record has that same value with an X
appended to it.
John W. Vinson [MVP]
|
|
0
|
|
|
|
Reply
|
John
|
1/24/2008 5:35:26 AM
|
|
FX05875 P Yes
FX05876 P Yes
FX05877A Yes
FX05878B Yes
FX05879 P Yes
FX05879X P Yes L 1
So with that logiic, you have one pair in the above
FX05879 AND FX05879X
And
FX05875 and FX05876 are not a pair - even though your sample has a P in
what looks like the Pair column.
I think that John Vinson has posted the beginnings of a solution. Did you
understand what he has posted and can you use that to get the deals marked
with pairs?
SELECT A.DEALNO, B.DEALNO
FROM yourtable AS A INNER JOIN yourtable AS B
ON B.DEALNO = A.DEALNO & "X";
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
"D" <D@discussions.microsoft.com> wrote in message
news:21A622A0-67F5-4071-A0DD-01A342386487@microsoft.com...
|
|
0
|
|
|
|
Reply
|
John
|
1/24/2008 12:33:27 PM
|
|
Thanks a lot both of you!
It is a start; I have to find out how do I incorporate all the other fields.
Thanks,
Dan
"John Spencer" wrote:
> FX05875 P Yes
> FX05876 P Yes
> FX05877A Yes
> FX05878B Yes
> FX05879 P Yes
> FX05879X P Yes L 1
>
> So with that logiic, you have one pair in the above
> FX05879 AND FX05879X
> And
> FX05875 and FX05876 are not a pair - even though your sample has a P in
> what looks like the Pair column.
>
> I think that John Vinson has posted the beginnings of a solution. Did you
> understand what he has posted and can you use that to get the deals marked
> with pairs?
>
> SELECT A.DEALNO, B.DEALNO
> FROM yourtable AS A INNER JOIN yourtable AS B
> ON B.DEALNO = A.DEALNO & "X";
> --
> John Spencer
> Access MVP 2002-2005, 2007-2008
> Center for Health Program Development and Management
> University of Maryland Baltimore County
> ..
>
> "D" <D@discussions.microsoft.com> wrote in message
> news:21A622A0-67F5-4071-A0DD-01A342386487@microsoft.com...
>
>
>
|
|
0
|
|
|
|
Reply
|
Utf
|
1/24/2008 1:34:02 PM
|
|
|
5 Replies
127 Views
(page loaded in 0.14 seconds)
Similiar Articles: Compare two strings and find longest common sub-string - microsoft ...Do the matches need to start at the same position, or may they be anywhere ... Wikipedia, the free encyclopedia Not to be confused with longest common substring ... To find ... how to detect that the end of a range is also end of a paragraph ...There are several ways including: Test whether the range and the last paragraph in the range have the same end eg If oRng.End = oRng.Paragraphs.Last.Range.End ... How to detect system language ? - microsoft.public.vc.mfc ...> How can I detect Windows system language or codepage by Win32 or MFC ? It depends ... should be different, because they are kind of far, even with if they use the same ... How to detect if hardware is Wake-on-LAN able ? network card or ...If it's an onboard NIC, the primary settings are in BIOS, even though there may be the same settings in the NIC properties. If it's an add-in NIC, the primary ... Remove characters in an ASCII decimal range: How To? - microsoft ...... for a space - and there are other characters that will do the same thing, > like &) when you don't concatenate anything to the > > (SELECT CASE WHEN ASCII(SUBSTRING ... Detect Difference Between Autorecover and Save - microsoft.public ...Why does saving take SOOO long? - microsoft.public.excel ..... 2003 file takes 4 or 5 seconds to save On mine the same file take between ... your computer and see if ... How to detect that a range object is in a table? - microsoft ...> Hi, > > How to detect that a range object is in a table? > > Thanks, ... in Excel 2010 and 2007 (VBA) Converting a range to a table starts with the same code ... how to select paragraphs to be printed - microsoft.public.word ...how do i select various paragraphs on the same page to be printed i can only highlight one paragraph at a time many thanks ... How to determine the number of decimal places in a number ...... and we have below two values: 123.34 123.3400 Both are exactly the same and ... SELECT @f; -- 0.100001000001 SELECT @v; -- 0.100001 SELECT LEN(SUBSTRING(@v ... How to check who are the users created the GL transactions ...I would like to know how to find which GP users enterred the GL transaction. There are many users can created the same type journal transactions, a... math - How to find next integer with same binary substring ...Consider the binary representation of two numbers: 5: “101” 10: “1010” “101” is a substring of “1010” but “00” and “111” are not. String.Substring Method - Microsoft Corporation: Software ...Retrieves a substring from this instance. Overload List. Retrieves a substring from this instance. The substring starts at a specified character position. progrm to find a substring in a string - C / C++Hi all,Could anybody tell me the most efficient method to find a substr ... What's the point in posting the same, unreadable, non-portable code in three ... SUBSTRING (Transact-SQL) - Microsoft Corporation: Software ...The returned string is the same type as the specified expression with the ... SELECT pr.pub_id, SUBSTRING(pr.pr_info, 1, 35) AS pr_info, SUBSTRING(npr.pr_info, 1 ... Substring Search - Algorithms, 4th Edition by Robert Sedgewick and ...A string a is a cyclic rotation of a string b if a and b have the same length ... Given two (or three strings), find the longest substring that appears in all three. 8/1/2012 4:19:52 AM
|