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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula to display ODBC name 1

Status
Not open for further replies.

bdpitta

MIS
Nov 7, 2002
49
Hello,
I recently started working with a company that uses a series of identicely structured ODBC databases to hold customer information. Each customer has its own database. However, nowhere in the database is there a place for a customer name field. The only way to know which customer you are looking at is to check the ODBC name.

I am trying to find a way to write a formula using crystal 8.5 that will allow me to display the database name in the reports that I create.

Any suggestions? I am completely lost.

Thanks.
 
is this report going to be run via CE? seems to me there might be some way to pull in a user id/login to identify the company. Other than that...
 
If you create a SQL Expression field, after giving it a name, expand the Functions > expand System > double click on 'DATABASE()'. You'll end up with "{fn DATABASE()}" as the text of the expression. Save and Close the sql expression editor, drag the SQL Expression you just created onto the report canvas, then preview the report to see if that's what you need/expect.

It never hurts to post:
CR version
Connectivity (which you did)
Type of database used

-dave
 
awesome. I did not have the database option listed under system, so I just typed what you show: {fn DATABASE()}
and this works very well.
Nice to know there is a reason for SQL expressions (am I allowed to say that? ) :)
 
SQL Expressions are extremely powerful and much more expansive than this for CR 8.5 and below.

You can create correlated subqueries and execute them on the database.

-k
 
This is exactly what I needed. Thank you very much!
 
synapsevampire -
I have been on cr9/10 for a while, so don't use sql expressions too much, since I imagine "most" of what they offer could be done in straight sql.
Is this correct?
Either way, do you have a good reference you could recommend on the use of SQL expressions?
Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top