Skip to Content
0
Former Member
Dec 16, 2006 at 03:07 AM

Using variables to build table names

20 Views

<p><font face="arial,helvetica,sans-serif" size="3">Hi, I&#39;m trying to build a report that I can easily adapt for different tables. For instance I have tables;</font></p><p><font face="arial,helvetica,sans-serif" size="3">cl_fra1_dynamic (France)</font></p><p><font face="arial,helvetica,sans-serif" size="3">cl_fra1_static (France)</font></p><p><font face="arial,helvetica,sans-serif" size="3">cl_ger1_dynamic (Germany)</font></p><p><font face="arial,helvetica,sans-serif" size="3">cl_ger1_static (Germany)</font></p><p><font face="arial,helvetica,sans-serif" size="3">cl_gbr1_dynamic (United Kingdom)</font></p><p><font face="arial,helvetica,sans-serif" size="3">cl_gbr1_static (United Kingdom) </font></p><p><font face="arial,helvetica,sans-serif" size="3">cl_usa1_dynamic (United States)</font></p><p><font face="arial,helvetica,sans-serif" size="3">cl_usa1_static (United States)</font></p><p><font face="Arial" size="3">and so on and on and on and on,</font></p><p><font face="Arial" size="3">All the reports I want to create are exactly the same apart from the table accessed.</font></p><p><font face="Arial" size="3">so in order to get data from </font></p><p><font face="Arial" size="3">cl_fra1_dynamic.DATA and cl_fra1_static.VALUE I want to use something like, </font></p><p><font face="Arial" size="3"><a href="mailto:cl_{@country}1_dynamic.DATA">cl_{@country}1_dynamic.DATA</a> and <a href="mailto:cl_{@country}1_dynamic.VALUE">cl_{@country}1_dynamic.VALUE</a> where <a href="mailto:{@country">{@country</a>} = fra </font></p><p><font face="Arial" size="3">I hope Im not being to dopy. Quite new to all this - but I do know the database administrator needs shooting!</font></p><p>Im using Crystal 9.2</p><p><font face="Arial" size="3">Cheers,</font></p><p><font face="Arial" size="3">Andrew Holway</font></p>