Basically the syntax seem to be ok, however it always depends on the content of your variables (and the SQL-interpreter). Suggest to check the script without using variables and then adopt your variables for the required syntax. With our database we needed to convert dates into a string with the format YYYY-MM-DD.
for the second question:
STORE $(vTableName) INTO $(vTableName)_$(vStartDate).qvd (QVD);
should do. Probably you may have to hand over a directory for the saving-location.