devxlogo

July 31, 2000

SQL Command to Retrieve Date

Question: What is the SQL command for retrieving the current date? Answer: The GETDATE() function returns the current date and time. Write it like this: SELECT GETDATE() AS CurrentDateCurrentDate —————————

Deleting a Column

Question: How do I delete a column, and all the values in it? Truncating will delete only the values, not the column itself. And I don’t want to drop the

Union Query

Question: I am writing a SQL statement in Access that is a union query. I am getting an error saying “The number of columns in the two selected tables or

Computed Values in Select Query

Question: Can I use computed values from a select list in a WHERE clause? For example: select age + 10 as AGE_10 from employee where AGE_10 > 50 Answer: This