Rabu, 23 Juli 2014

Re: [MS_AccessPros] help with my query

 

Sarah-


Is there really a zero length string in insfrom, or does it contain a blank?  A single blank character will be greater than "", so the empty rows won't be selected.  On the other hand, if insfrom contains nothing - a Null, then any predicate using that control will always be false.  But if that were the case, then your syntax using NZ on insfrom should have taken care of that.

Just throwing spaghetti at the wall to see what sticks…

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Jul 23, 2014, at 9:21 PM, sarahk@schemesoftware.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Table =a/r trans

field =insrcd (allow zero length=yes)

insfrom=""

insto=max value of insrcd in a/r trans file


query:

where (nz([a/r trans]![insrcd],"") Between [Forms]![arledger]![insfrom] And [Forms]![arledger]![insto]) 


 I am trying to select all records, regardless of insrcd.it does not select any records where the insrcd is empty. I assume because it is zero length.


Also tried:

where (nz([a/r trans]![insrcd],"") Between nz([Forms]![arledger]![insfrom],"") And nz([Forms]![arledger]![insto],"")) 

same results, records without an insrcd are not selected.


What am I doing wrong?

using Access 2003/ windows Vista

Thanks for helping


Sarah


__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

Yahoo Groups
Improved Group Homepage!
The About page of your Group now gives you a heads up display of recent activity, including the latest photos and files

Yahoo Groups
Control your view and sort preferences per Yahoo Group
You can now control your default Sort & View Preferences for Conversations, Photos and Files in the membership settings page.


.

__,_._,___

Tidak ada komentar:

Posting Komentar