?
Solved

Convert SQL expressions to dBase expressions?

Posted on 2006-10-20
6
Medium Priority
?
1,379 Views
Last Modified: 2008-01-23
Need to write some simple dBase expressions for a filter in Goldmine to filter all records that have been updated in the last year.  I can struggle thru them in SQL, but Goldmine has to have a dBase equivalent expression to make it work.

Here's what I have in SQL:

WHERE c1.LASTDATE >= DATEADD(dd,-365,GETDATE())

Is there any software that could take an SQL expression like this & show me the dBase equivalent?

Thanks.....
0
Comment
Question by:cricketman
[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
  • 2
6 Comments
 
LVL 33

Accepted Solution

by:
CarlWarner earned 600 total points
ID: 17775842
I know of no magic bullet software.

As far as an expression for dBASE, dBASE likes to see a FOR construct in its queries.

Simply try that same construct withjust the SQL WHERE keyword in your Goldmine expression builder.

This logocal condition would be added to the the dBASE FOR clause:
c1.LASTDATE >= DATEADD(dd,-365,GETDATE())

Since the success of the query depends on entities it works on being active, it could fail.  But, you need to find that out by testing it.  IOW, is "c1" an active/open table or is it an alias supplied to SQL?  Is GETDATE() an available function call?  Is DATEADD() also an available function that can get executed to return a real date that can be evaluated?
0
 

Author Comment

by:cricketman
ID: 17776816
GM must actually "assume" the WHERE and FOR commands, as when I looked at the SQL query again it really was just:

c1.LASTDATE >= DATEADD(dd,-365,GETDATE())

Through trial & error I figured out what I needed in the dBase expression to match it, which is:

DtoS(contact1->lastdate) >= DtoS(DATE()-365)

Got it working.... still hoping someone will point me towards a solution that I can use routinely.  If not "magic software"... perhaps just a list of comparable expressions?  (... "this" in SWQL = "this" in dBase, etc).

Thanks....
0
 
LVL 33

Expert Comment

by:CarlWarner
ID: 17776905
Have you determined that the use of DtoS() is absolutely necessary?  It seems that the comparison of dates without that string conversion should work just fine and the DtoS() may be redundant.

Also, I see c1 was an alias for contact1.
0
 

Author Comment

by:cricketman
ID: 17776972
NO, don't know if it is absolutely necessary or not... just copied it from another GM filter that was working, and played with the syntax till I got the expected results.

And yes, c1 was an alias for table contact1.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

777 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