Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to be able to select Date and changes in History Field 2

Status
Not open for further replies.

fcullari

IS-IT--Management
Oct 28, 2002
30
US
I've been researching how to sort a query by a date within a history field.
Beginning of field -
On 03/21/06 10:08:00 AM SM made the following changes:The Value For Misc 11 was changed from to BTThe Value For Misc 13 was changed from to RETOn
04/18/06 10:08:07 AM SM made the following changes:The Cost was changed from $5.4300 to 5.7500Units Cost for Color WH and size 36 and dimension 3D was changed from $5.4300 to 5.7500Units Cost for Color WH and size 36 and dimension C was changed from $5.4300 to 5.7500Units Cost for Color WH and size 36 and dimension D was changed from $5.4300 to 5.7500Units Cost for Color WH and size 36 and dimension DD was changed from $5.4300 to 5.7500Units Cost for Color WH and size 38 and dimension 3D was changed from $5.4300 to 5.7500Units Cost for Color WH and size 38 and dimension C was changed from $5.4300 to 5.7500Units Cost for Color WH and size 38 and dimension D was changed from $5.4300 to 5.7500Units Cost for Color WH and size 38 and dimension DD was changed from $5.4300 to 5.7500Units Cost for Color WH and size 40 and dimension 3D was changed from $5.4300 to 5.7500Units Cost for Color WH and size 40 and dimension C was changed from $5.4300 to 5.7500Units Cost for Color WH and size 40 and dimension D was changed from $5.4300 to 5.7500Units Cost for Color WH and size 40 and dimension DD was changed from $5.4300 to 5.7500Units Cost for Color WH and size 42 and dimension 3D was changed from $5.4300 to 5.7500Units Cost for Color WH and size 42 and dimension C was changed from $5.4300 to 5.7500Units Cost for Color WH and size 42 and dimension D was changed from $5.4300 to 5.7500Units Cost for Color WH and size 42 and dimension DD was changed from $5.4300 to 5.7500
End of Field

I need to be able to query this field and print on a report if Date = 4/18/2006 only those changes in the History Field.

I tried using:
stringvar array x := split({prbunhea_1.pohistory},"/",2);
numbervar i;
numbervar j := ubound(x);
numbervar k;
stringvar y := "";

for i := 1 to j do(
if instr(x,"On") > 0 then (
numbervar m := len(x);
for k := 1 to m do(
if isnumeric(x[k]) then
y := y + x[k])));
y

This formular I pulled from another posting.
and it's results are :
0321061008001113041806100807543005750036354300575003654300
5750036543005750036543005750038354300575003854300575003854
3005750038543005750040354300575004054300575004054300575004
0543005750042354300575004254300575004254300575004254300575
00
It has the dates in there plus a whole lot of other stuff.
Can someone help me???


 
Hi,
Your Split using the '/' char may not do what you need..

It will place
Code:
On 03/   In x[1]
21       in x[2]
06 10:08:00 AM SM made the following changes:The Value For Misc 11 was changed from  to BTThe Value For Misc 13 was changed from  to RETOn 
04       in x[3]

Will this work with the rest of your code?





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Is "On" the only way to delimit the text within the field? You could try:

stringvar array x := split({table.field},"On");
numbervar i;
stringvar y := "";

for i := 1 to ubound(x) do(
if instr(x,totext(date(2006,04,18),"MM/dd/yy")) > 0 then
y := x);
y

-LB
 
Thanks, I'm almost there now. But instead of a coded date I need to use a formula date @Transdate or a Parameter Date ?Date. What do I need to change to make that work.
 
stringvar array x := split({table.field},"On");
numbervar i;
stringvar y := "";

for i := 1 to ubound(x) do(
if instr(x,totext({?date},"MM/dd/yy")) > 0 then
y := x);
y

Make sure that {?date} is set up as a date parameter.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top