Mahesh- Are you using ADO from VB6? If so, you need to change the wildcard:
SELECT * FROM T1 WHERE F2 LIKE "45,%" OR F2 LIKE "%,45,%" OR F2 LIKE "%,45" OR F2 = "45" John Viescas, author "Building Microsoft Access Applications" "Microsoft Office Access 2003 Inside Out" "Running Microsoft Access 2000" "SQL Queries for Mere Mortals" http://www.viescas.com/ -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Mahesh kumar Sent: Wednesday, November 02, 2005 5:21 AM To: [email protected] Subject: RE: [ms_access] Help!!! Query Hi john, Your query is working fine in ms-access, but if you use the same query in VB6.0 programming is returning few records compared to that of ms-access. In my observation I found that in our criteria i.e. "45,*" , "*,45,*"..."45" only f2="45" satisfied records are only returned, query is not fetching for other criteria, but if you run the same query in ms-access its returning all the records which satisfies any one condition from all the four conditions. Why like that? Any solutions? Thanks in advance regards mahesh John Viescas <[EMAIL PROTECTED]> wrote: SELECT * FROM T1 WHERE F2 LIKE "45,*" OR F2 LIKE "*,45,*" OR F2 LIKE "*,45" OR F2 = "45" John Viescas, author "Building Microsoft Access Applications" "Microsoft Office Access 2003 Inside Out" "Running Microsoft Access 2000" "SQL Queries for Mere Mortals" http://www.viescas.com/ -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of access_mk Sent: Friday, October 28, 2005 5:51 AM To: [email protected] Subject: [ms_access] Help!!! Query Hi, I have a table (T1 )with two fields F1 F2 ----------------------- A123 45,67,89,333 B23 455,666,56,78 C456 67,44,3,145 D46 34,5,45,66 Now I want to fetch those records in which F2 contains value 45 ie. select F1 from T1 where 45 in (F2). serach value is only 45, not 145,455 Please help me out Yahoo! Groups Links --------------------------------- YAHOO! GROUPS LINKS Visit your group "ms_access" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. --------------------------------- --------------------------------- Yahoo! FareChase - Search multiple travel sites in one click. [Non-text portions of this message have been removed] ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/q7folB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links ------------------------ Yahoo! Groups Sponsor --------------------~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/q7folB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/ms_access/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
