Hot Topic (More than 10 Replies) Programmed Retrieves (Read 1345 times)
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Programmed Retrieves
Mar 21st, 2004 at 12:51am
Print Post Print Post  
I'm having trouble getting this programmed retrieve spec to work.  It has worked perfectly in Q&A.  Is there a different syntax for sesame?

{Installed<>"" and @rest(Amount Paid1,"=")}; {Installed<>"" and @rest(Amount Paid2,"=") and Paid Note2<>""}

This is the trouble spot: { @rest(Amount Paid1,"=") }
The @rest() expression here should find blank entries in Amount Paid1.  I can't get this to retrieve any records, even though there are some with blanks in Amount Paid1.  I have tried other criteria within the quotes, but still no results.

I found that the new release (Version 1.0.2) has a new SBasic command - @IsBlank(element).  I thought that this would be my answer, but it retrieves ALL the records.

Then the opposite happens:  If you put {@IsBlank(Name)} in the same element that is referenced within it (i.e. Name, in this example), Sesame will retrieve NO records at all.

Am I missing something?
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Programmed Retrieves
Reply #1 - Mar 21st, 2004 at 1:34am
Print Post Print Post  
Hi Carl

Is this issue what was noted in the Known Problems:

Quote:
Bug: Issues with blank values in numeric and date fields.

Symptoms:
Retrieving records using > < = and /= may retrieve or fail to retrieve records with balnk values.

Workaround:
None

Status:
Fixed in Sesame 1.0.2


What happens if you use @IsBlank in your retrieve spec with full form path, something like this:
{@IsBlank(frmFormName!ElementName)}  OR
{@IsBlank("frmFormName!ElementName")}

(Had no time today to test 1.0.2 documentation for syntax yet, but had questions about CursorPosition syntax in another post.)
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Programmed Retrieves
Reply #2 - Mar 21st, 2004 at 2:06am
Print Post Print Post  
Hi Bob,

I am using the new version (1.0.2).

I tried both of your suggestions - no results.

Thanks for your input.  I hope Mark can shed some light on this.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Programmed Retrieves
Reply #3 - Mar 21st, 2004 at 2:41am
Print Post Print Post  
Quote:
I am using the new version (1.0.2).

I knew that.  That's why I pointed out the previous problem.  Is this the same one that was supposed to be fixed, or is it something new?  I never tested for the previous condition in 1.0.1..
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Programmed Retrieves
Reply #4 - Mar 21st, 2004 at 4:55am
Print Post Print Post  
Quote:
{Installed<>"" and @rest(Amount Paid1,"=")}; {Installed<>"" and @rest(Amount Paid2,"=") and Paid Note2<>""}



Carl, the following in the retrieve spec programming gets you the desired results, I think....

{Installed<>"" and Amount Paid1 = "")}; {Installed<>"" and Amount Paid2 = "" and Paid Note2<>""}
  
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Programmed Retrieves
Reply #5 - Mar 21st, 2004 at 6:28am
Print Post Print Post  
The function from Bharat_Naik looks like what you want.

I think that your @REST function is looking for a literal "=" vs. the RetrieveSpec "=" that I think you are trying to do. Since that is a Currency element then you can never have an equal sign in the element, so you will fail on every record.

From the manual:
Quote:
Alone among all the text/string functions, @Rest accepts Retrieve Spec-like
begins with, ends with and contains parameters:
If @Rest(Company, "Int..") Then...
Although @REST  is suposed to accept Retrieve Spec types of strings, I think that is limited to the ".." wild card at the beginning or end of a string, like "..ABC" or "ABC.." or "..ABC..".

Try putting a real equal sign "=" in the element and see what happens, I think it will come back as found.  In your sample case that might be a problem because you are looking at currency but I think this test will require a text element.  You could also try @REST(Amount Paid,"") to look for a blank field

So what does REST stand for? REsides in STring?
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Programmed Retrieves
Reply #6 - Mar 21st, 2004 at 6:12pm
Print Post Print Post  
Quote:
Try putting a real equal sign "=" in the element and see what happens, I think it will come back as found.
You are correct, it treats it as a literal character.  This will find an equal sign in a text field.

Quote:
You could also try @REST(Amount Paid,"") to look for a blank field
This does not work because it appears to treat "" as "0.00", but I want blank, not zero.

Quote:
So what does REST stand for? REsides in STring?
I'm guessing that it stands for RESTrict spec.
Edit: After reading this again, I don't know what I was thinking.  This doesn't make any sense, does it? Cheesy

Quote:
I think that is limited to the ".." wild card
It's supposed to handle all the retrieve specs...
The Sesame manual states that @REST(x,m) "Returns true if the element referred to by x contains a value that matches m. M can be any valid retrieve specification."

It works in Q&A the way this Sesame definition indicates it should.
« Last Edit: Mar 22nd, 2004 at 2:17am by Carl Underwood »  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Programmed Retrieves
Reply #7 - Mar 21st, 2004 at 6:42pm
Print Post Print Post  
I can't believe that after all these years I never used that function in Q&A.  Never even remember seeing it anywhere.  Roll Eyes When you first mentioned it, I thought it was a new Sesame Spec. Embarrassed Thanks for the intro.......  Grin

In any case, your original question is still unanswered:
Why does it work in Q&A, but not in Sesame?
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Programmed Retrieves
Reply #8 - Mar 22nd, 2004 at 10:15pm
Print Post Print Post  
@IsBlank is not enabled in RetrieveSpec programming in 1.0.2. We've put it in for 1.0.3.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Programmed Retrieves
Reply #9 - Mar 22nd, 2004 at 10:59pm
Print Post Print Post  
Carl's first formula was:
Quote:
{Installed<>"" and @rest(Amount Paid1,"=")}; {Installed<>"" and @rest(Amount Paid2,"=") and Paid Note2<>""}
And he discovered that "=" did not work.

Forgetting that @IsBlank will not be available until 1.0.3, is the solution to replace "=" with @IsBlank like this:
Quote:
{Installed<>"" and @IsBlank(Amount Paid1)}; {Installed<>"" and @IsBlank(Amount Paid2)) and Paid Note2<>""}
or is the non working "=" still to be resolved?

What would the syntax be in his formula for Not Blank? Something like this?
Quote:
{Installed<>"" and @IsBlank(Amount Paid1)=0}; {Installed<>"" and @IsBlank(Amount Paid2)=0) and Paid Note2<>""} 
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Programmed Retrieves
Reply #10 - Mar 22nd, 2004 at 11:16pm
Print Post Print Post  
It would be something like:

{(Installed<>"" and @IsBlank(Amount Paid1)=0) OR ((Installed<>"" AND @IsBlank(Amount Paid2)=0) AND Paid Note2<>"")}
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Programmed Retrieves
Reply #11 - Mar 22nd, 2004 at 11:37pm
Print Post Print Post  
Got it.....two or more {formula}s separated with semi-colons must become one formula, each section to be grouped with "(....)" and use OR vs. the semicolon.

And that must also be the same structure for the original IS BLANK formula also vs. the sample I provided.  Should be:
{(Installed<>"" and @IsBlank(Amount Paid1)) OR (Installed<>"" and @IsBlank(Amount Paid2)) and Paid Note2<>"")}

  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged