Solved

Convert SQL expressions to dBase expressions?

Posted on 2006-10-20
6
1,320 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
  • 2
  • 2
6 Comments
 
LVL 33

Accepted Solution

by:
CarlWarner earned 150 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
xBase++ 6 68
sql calculate reminders 11 56
Client backup and data retention? 3 45
oracle query help 18 78
Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now