Normal Topic XResultSetSearch question (Read 655 times)
CapitalG
Full Member
Members
***
Offline



Posts: 143
Location: Phoenix, Arizona
Joined: Mar 4th, 2003
XResultSetSearch question
Dec 14th, 2010 at 6:55pm
Print Post Print Post  
I am having trouble getting the right code when using XResultSetSearch.  I have come close, but need some help on how to search for a date range using a year entered on form and merging it into the search.  This is the latest I have tried:
Code
Select All
vRSID = @XResultSetSearch(@FN, "Data!Detail", SEARCH_MODE_AND, SEARCH_SYNTAX_QA,"!Driver=" + ID, "!RtDate>=" + Bonus Year + "/01/01..<=" + Bonus Year + "/12/31") 


The code limits by Driver, but includes all dates.  Bonus Year is a 4 digit year.  I have tried @toDate() and {} in all different combinations. Please let me know how to do this.

Thank you.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: XResultSetSearch question
Reply #1 - Dec 14th, 2010 at 7:47pm
Print Post Print Post  
Try wrapping Bonus Year in @Str to make sure it is concatenating, as opposed to trying to add it as a number. Also, you need another equal sign after RtDate. The syntax is !FieldName=Criteria. So, if the criteria is ">=Something" then the statement needs to read "!Fieldname=>=Something".

Try this:
vRSID = @XResultSetSearch(@FN, "Data!Detail", SEARCH_MODE_AND, SEARCH_SYNTAX_QA,"!Driver=" + ID, "!RtDate=>=" + @Str(Bonus Year) + "/01/01..<=" + @Str(Bonus Year) + "/12/31")
  

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



Posts: 143
Location: Phoenix, Arizona
Joined: Mar 4th, 2003
Re: XResultSetSearch question
Reply #2 - Dec 14th, 2010 at 8:58pm
Print Post Print Post  
Thanks.  Smiley  That was the missing piece.  Works great.
  
Back to top
 
IP Logged