Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SEARCH MEMO FIELD IN VFP9 SP2

Posted on 2011-02-13
2
Medium Priority
?
494 Views
Last Modified: 2012-05-11
Hi Experts
I would like to copy records to a file that has certain item values in a memo field using

Select * from MYtable where (memo field (mem_prod) has 20/5/2010 in it  ) into a table or cursor

Thanks
0
Comment
Question by:b001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 43

Accepted Solution

by:
pcelba earned 1000 total points
ID: 34883837
Test for substring in the memo field should be slow but we have no faster possibility:

SELECT * FROM MYtable WHERE "20/5/2010" $ mem_prod INTO TABLE NewTableName

The "20/5/2010" string is tested for exact match, so it should not contain spaces or different separators.
0
 
LVL 12

Assisted Solution

by:jrbbldr
jrbbldr earned 1000 total points
ID: 34888127
Pavel's advice is on the mark.

The only thing that I might add would be that you should possibly add other possibilities for the way a date might be entered into a Memo field.  

This would only be necessary if the input were from individuals manually entering the memo field content.
But if that were the case you might also add:

SELECT * ;
   FROM MYtable ;
  WHERE "20/5/2010" $ mem_prod ;
  OR "20/5/10" $ mem_prod
  INTO TABLE NewTableName

NOTE - Perhaps you are entering your Date as DD/MM/YYYY in some manner and, if so, ignore this.   But if you are using the more standardized  MM/DD/YYYY, the sample you gave above for the Date searched for might need a look-over.

Good Luck
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Here in this article, you will get a step by step guidance on how to restore an Exchange database to a recovery database. Get a brief on Recovery Database and how it can be used to restore Exchange database in this section!
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question