using a function within an SQL query

J

Joshua Weir

Hi,

i want to feed a random seed into my query therefore i implemtented a
function called Randomizer() into a module.

function randomizer() as integer
Static alreadydone as integer
if alreadydone = false then randomize: alreadydone = true
Randomizer = 0
End Function

IN my SQL statement i have:

SELECT ....
FROM .....
WHERE Randomizer() = 1

However i get the following compiler error:

Compile error. in query expression 'randomizer() = 1'.

I dont understand why? Please help.

Joshua Weir
 
J

Joshua Weir

I just realized that it is the 'Randomize' statement in the randomizer
function, if i comment this out, my query works! Does anyone know why this
wouldnt work?
 

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

Similar Threads


Top