John Jason Jordan wrote:
On Sun, 24 Feb 2008 04:52:58 -0500
Drew Jensen <[EMAIL PROTECTED]> dijo:
There are still a couple problems:
1) When i created the table in Base into which I appended the data from Calc I
set the fields to memo, except for QuestionCode (fixed, 12, required) and
AnswerKey (fixed, 1, required). I need to set QuestionCode to unique as well,
but I can't find any way to do that.
If you designate it the Primary Key it becomes unique by definition -
otherwise you just add a unique index. To do that you open the table in
design mode. Table section, oepn the table definition for edit. On the
toolbar at the top of window you will find the tool button 'Index
Design' - in this dialog select new index, select your field and tick
the checkbox 'Unique'.
2) I recreated the query that was giving me trouble in the Base-Kexi database,
i.e., the sort was not working. Well, it's still not working. I need to sort
the records on the last three characters of the selection string, not on the
entire value of the field. The SQL of the query is:
SELECT * FROM "MainBank" WHERE ( ( "Selections" LIKE '%LFc-___' ) ) ORDER BY
"Selections" ASC
I can't do it in design view - that is, in design view I can specify sort as
ascending or descending, but it sorts on the entire contents of the field, not
just the portion in the select string (see SQL above). I don't understand HSQL
syntax well enough to change the ORDER BY manually. Maybe I could insert the
selection string into another field and sort on that field? (I have an unused
field that I could use.) But if so, the insertion would have to be temporary,
otherwise the unused field would quickly fill up from successive queries.
Any suggestions for the remaining problems?
Your criteria selection is only that criteria for selecting the rows -
it doesn't alter the value in any column - and that is what you need to
do now so you need two of the string functions LOCATE and SUBSTR. You
add a column to sort on that is calculated using these.
SELECT * FROM "MainBank"
WHERE ( ( "Selections" LIKE '%LFc-___' ) )
ORDER BY SUBSTR( "Selections", LOCATE( 'LFc-', "Selections") + 4, 3) ASC
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]