Thanks Tamil,

But I put this code into SQL server and Access and it didnt work. what have I done wrong?? Didnt get any output, just errors.