Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

varible's used in creating .cdx's

Status
Not open for further replies.

ejhemler

Programmer
Aug 30, 2002
68
US
I'm trying to create a compound index for a table in the code by using a variable name as the name of the index. but I keep getting an error. The variable hold's a date value. This is the code I'm using.

mdate = date()
index on fieldA, fieldB tag dtos(&mdate)

Is this the right syntax?
 
First, an index is always based on an expression, not a field list. So if fieldA and fieldB are both character fields, then you'd use fieldA+fieldB. If they are other types or mixed types, you'll need to convert them so they can be concatenated in a meaningful way.

Second, the tag name can't be an expression, it must be a "name" that starts with a letter or underscore and be 10 or less characters. In this case you could use:
Code:
myTagName = "_"+dtos(date())
index on fieldA+fieldB tag &myTagName
Rick


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top