1.how to wrote syntex in query at column 4 to show 'y' if column 3 matches column 2 or column 1 data?
2. how to substract current date from column data to see it is over 6 months or not? tried many times but not sucess.
thank you in advance!
1.how to wrote syntex in query at column 4 to show 'y' if column 3 matches column 2 or column 1 data?
2. how to substract current date from column data to see it is over 6 months or not? tried many times but not sucess.
thank you in advance!
Please provide an example of your starting data and what you want as a result.
As for Date related calculations, research the DateDiff function.
Good luck.
tks for your reply! i am thinking to add something for column 2 criteria..
1. or [column 1]
2. at column 4 criteria..
match [column 3] and [column 2]
is the syntex and logic correct?
thank you for any advice.
Frederic,
For clarity, please provide an example or 2 showing:
-typical values for your column2, 3 and 4
-what exactly your columns represent
-a step by step breakdown of what matches what and the next step if there is/is not a match
-the final result of each example
Frederic,
Based on your limited response, here is a mock up that may be helpful
This is the output.Code:Sub frederic() Dim oldname As String, newname As String, othername As String, matchresult As Boolean Dim i As Integer oldname = "abc" newname = "bca" othername = "acb" Debug.Print "Oldname", "OtherName", "This vs", "This ", "Result " For i = 1 To Len(oldname) If Mid(othername, i, 1) = Mid(oldname, i, 1) Then matchresult = True Debug.Print oldname, othername, Mid(othername, i, 1), Mid(oldname, i, 1), matchresult Else matchresult = False Debug.Print oldname, othername, Mid(othername, i, 1), Mid(oldname, i, 1), matchresult End If Next i End Sub
Code:Oldname OtherName This vs This Result abc acb a a True abc acb c b False abc acb b c False
thanks! but problems with
1. all records numbet over 17k and should not be hard code?
2. abc not match with a
in fact, just compare 2 columns of data to see match or not. that is true or false. just think of only one column has new and old name but they are the same record. either one (match new 'or' old should be true with column 3 (the other record). just to check any discrepancy input.
thank you once again.
What is 'other record'? Other record from where?
IIf([oldname]=[other name] Or [newname]=[other name], True, False)
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Fred,
As mentioned previously in #2 and #4, you should provide more details of your requirement and/or samples showing the type of data you are dealing with and whatever transformations you expect on that data.
I provided a simple mock up in post 6, but it was just one of many possible responses.
If you can't describe and communicate what you are trying to accomplish, no one can provide a solution.
We are willing to help, but need information from you who knows the requirements.
Are you dealing with records from tables???? An existing database??
Readers need to know "what" before suggesting "how".
Good luck.
Yes. Will try the statment when back to office.
Thank you all of you!