To clarify, I have been able to get a variable that returns the correct answer to whether the filename exists in the Archive field or not. The problem occurs with the following If..then..else..end if part. So far I've been using this structure:
If vArchive='False' then
From [file location](qvd);
Store Tablename into [archive file location](qvd)
Drop tables ArchiveFiles, Tablename;
Drop table ArchiveFiles;
What's happening is that the value of vArchive is equal to True, but the if statement is acting as if it's False.
Thank you, I think that will help. Unfortunately I think I either misidentified the problem or changed something in the variable creation that broke it, because as of right now I can't get the variable to give me the correct value.
I've tried quite a few different ways to create the variable, using the Match() and WildMatch() and Peek() functions, and none of them seem to be working. I want it to return True if a value exists in the Archive field, or False if it doesn't. Here are a couple examples of ways I've tried to do it:
Let vArchive = If(Match('CostArchive', Peek('Archive')), True(), False());
Let vArchive = If(Match(Archive, 'CostArchive'), True(), False());
Let vArchive = If(Peek('Archive')='CostArchive', True(), False());
I've also tried it using 1 and 0 instead of true and false. The variable always returns False, even though the value 'CostArchive' exists within the field Archive. Is there some better way of checking to see if a value exists in a field? I've also tried using Count(If()) and Exists(), but that hasn't worked either.