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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you filter by comparing 2 fields on same record in a .adp?

Status
Not open for further replies.

Waynest

Programmer
Jun 22, 2000
321
GB
I'm using access2000 as a front end to a SQL server database.<br>I want to define a macro which uses the ApplyFilter action to set the Where Condition so that I only get records where Ordered &lt; Received (on the same record).&nbsp;&nbsp;When I try a Where Condition of [Ordered] &lt; [Received] I get a message saying filter cant be applied but it works if I try [Ordered] &lt; 100 or similar.&nbsp;&nbsp;My field types are both Numeric&nbsp;&nbsp;- I've tried changing them to Int with no effect.<br>Agh! Any ideas?
 
this works for me.<br>SELECT table1.ordered, table1.received <br>FROM table1<br>WHERE (((table1.ordered)&lt;[table1].[received]));<br>
 
Yup, I resorted to toggling the form recordsource property earlier today which will make do, but what I'm after is a way of modifying the server filter which would be neater (I need to be able to switch it on & off with a button y'see).&nbsp;&nbsp;I think what happens is that when you filter by [ordered] &lt; [received] is that access stitches it together & interprets it as [ordered] &lt; &quot;[received]&quot; seeing as [ordered] &lt; Val([received])is accepted but doesnt give the desired results.&nbsp;&nbsp;Anyone know of a magic character or something which makes access recognise that the filter criteria is another field?<br><br>ps - thanks for the reply
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top