forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[resolved] VDSDB: 'LIKE' expression retrieves no results...

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    forum.vdsworld.com Forum Index -> Product Support
View previous topic :: View next topic  
Author Message
arcray
Valued Contributor
Valued Contributor


Joined: 13 Jul 2001
Posts: 242
Location: Aude, France

PostPosted: Fri Nov 28, 2003 10:33 am    Post subject: [resolved] VDSDB: 'LIKE' expression retrieves no results... Reply with quote

I can't get the LIKE expression to work using VDSDB.DLL version 2! The Date Query works fine, but both the Postcode & Quote Query do not work!

Am I getting the syntax wrong?

There is a segment of code below, which is used to populate an EXTLIST:-

Code:

  %%ENDIF = ListBegin
  IF @EQUAL(%K,Date)
    %%Query = "SELECT QuoteNo, RDate, Business, BusType, PostCode, BuildSI, ContSI, StockSI, Gross, IPT, Net, OnCoverYN FROM NU WHERE (((QDate) Between #"%%Date1"# And #"%%Date2"#));"
  END   
  IF @EQUAL(%K,Postcode)
    %%Query = "SELECT QuoteNo, RDate, Business, BusType, PostCode, BuildSI, ContSI, StockSI, Gross, IPT, Net, OnCoverYN FROM NU WHERE ([Postcode]) LIKE '"%J"*';"
  END   
  IF @EQUAL(%K,Quote)
    %%Query = "SELECT QuoteNo, RDate, Business, BusType, PostCode, BuildSI, ContSI, StockSI, Gross, IPT, Net, OnCoverYN FROM NU WHERE ([QuoteNo]) LIKE '"%J"*';"
  END
 
  %Z = @INPUT(Query,%%Query)
 
  EXTLIST ADD,COLLIST,COLLIST1,1,1,798,598,QuoteNo|60@CR()Renewal Date|80@CR()Business|150@CR()BusinessType|80@CR()PostCode|80@CR()BuildingsSI|80@CR()ContentsSI|80@CR()StockSI|80@CR()Gross|80@CR()IPT|80@CR()Net|80@CR()OnCoverYN|60,DBLCLICK,COLUMNCLICK
  DB QUERY,%%Query
  DB FETCHROW
  IF @OK()
    %A = 1
    REPEAT
     %%Query = @DB(GET,QuoteNo)@TAB()@DB(GET,RDate)@TAB()@DB(GET,Business)@TAB()@DB(GET,BusType)@TAB()@DB(GET,PostCode)@TAB()@FORMAT(@DB(GET,BuildSI),5.2)@TAB()@FORMAT(@DB(GET,ContSI),5.2)@TAB()@FORMAT(@DB(GET,StockSI),5.2)@TAB()@FORMAT(@DB(GET,Gross),5.2)@TAB()@FORMAT(@DB(GET,IPT),5.2)@TAB()@FORMAT(@DB(GET,Net),5.2)@TAB()@DB(Get,OnCoverYN)
     EXTLIST LIST,ADD,COLLIST1,%%Query
     %A = @SUCC(%A)
     DB FETCHROW
   UNTIL @NOT(@OK())@EQUAL(%A,100)
   IF @EQUAL(%A,100)
     INFO You have over 100 quotes in the requested data range!@CR()@CR()Try amending the selection criteria...
   END 
  ELSE
    IF @ASK(There are no retrieved records! Do you want to try again?)
     %%ENDIF = GetButton
   ELSE
     %%ENDIF = EvLoop
      EXTLIST REMOVE,COLLIST1 
      DIALOG HIDE,LISTSGROUP
   END 
  END
  GOTO %%ENDIF


The %Z = @INPUT(Query,%%Query) produces an SQL string that works fine in Access97, Access2000 and Access2003, but not using VDSDB.DLL

Thanks in advance

_________________
Andrew GRAY
If you don't know I am looking for work, I won't get the job.

andrewrcgray.com
Back to top
View user's profile Send private message Send e-mail
arcray
Valued Contributor
Valued Contributor


Joined: 13 Jul 2001
Posts: 242
Location: Aude, France

PostPosted: Tue Dec 02, 2003 8:07 am    Post subject: Reply with quote

I have replaced the LIKE with >= which does work!

Code:

   IF @EQUAL(%K,Postcode)
    %%Query = "SELECT QuoteNo, RDate, Business, BusType, PostCode, BuildSI, ContSI, StockSI, Gross, IPT, Net, OnCoverYN FROM NU WHERE Postcode >= '"%J"';"
  END   


So I am sorted now thanks!




Andy

_________________
Andrew GRAY
If you don't know I am looking for work, I won't get the job.

andrewrcgray.com
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    forum.vdsworld.com Forum Index -> Product Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group