Too comples Query - (I cant use VBA) or system resource exceeded

G

Guest

I have this Query:
Stud Name, Stud ID, EXAM, expr1=round(EXAM), expr2=10*EXAM-10*round(EXAM),
expr3=(exam with words)
I take from another table the exam degrre and i round it to take the 4 fe
if the exam deggre is 4,8. Then i do 10*EXAM-10*(round(EXAM)), to take the
eight. After all that i must write the name of the number so i write an
expression like that:
if ( exam2=1; "ena"; if(exam2=2; "dio"; ..... )) +if(exam3=1; " kai ena
dekato"; if(exam=2.....)). When i go to run the query i take the message "too
complex" or system resource exceeded. What can i do? I cant use VBA because i
must write the name of the numbers in greek and VBA doesnt write in greek.
What can i do?
 
N

Nikos Yannacopoulos

Andrea,

Yes, you should use VBA for this, and you certainly can have Greek in
there. What you need is a function in VBA, to which you pass the numeric
grade as a parameter, and it returns the text. Try this:

Function Grade_Text(vGrade As Double) As String
Dim vWord(10) As String
Dim vInt As Integer
Dim vDec As Integer
Dim vText As String
vWord(0) = "μηδέν" 'zero
vWord(1) = "ένα" 'one
vWord(2) = "δÏο"
vWord(3) = "Ï„Ïία"
vWord(4) = "τέσσεÏα"
vWord(5) = "πέντε"
vWord(6) = "έξι"
vWord(7) = "επτά"
vWord(8) = "οκτώ"
vWord(9) = "εννέα"
vWord(10) = "δέκα" 'ten
vInt = Int(vGrade)
vDec = 10 * (vGrade - vInt)
vText = vWord(vInt) & " και " & vWord(vDec) 'and
If vDec = 1 Then
vText = vText & " δέκατο" 'tenth
Else
vText = vText & " δέκατα" 'tenths
End If
Grade_Text = vText
End Function

Just call the function from wherever you need it, and it will return the
text string.

Evereyone else, sorry for the Greek, I have put the english words as
comments at the end of the lines so it's understandable, in case someone
else needs it.

HTH,
Nikos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top