i have some experience with MySQL but none with SQL Server, i have a computer who host a database (SQL Server 2000) and i have local access to it. The think is that one column of the table NomAntiguedad need to be change from a given date period; I need to multiply by 0.01 all the values of the column between the values of mesano (05/2007 to actual date, format: MM/YYYY).
How can i have VISUAL access to the data base, like when i administrate my data bases on PhpMyAdmin 开发者_如何学Pythonin order to see the tables format?
What would be the syntax of the command to do what i need?
How can i have VISUAL access to the data base, like when i administrate my data bases on PhpMyAdmin in order to see the tables format?
There's the defacto SQL Server Management Studio (Express Edition is free), or Toad for SQL Server (free if <5 people use it in-house) applications...
The think is that one column of the table NomAntiguedad need to be change from a given date period; I need to multipli for 0.01 all the values of the column between the values of mesano (05/2007 to actual date, format: MM/YYYY).
You need to use an UPDATE statement:
UPDATE NomAntiguedad
SET your_column = .01 * your_column
WHERE mesano = '05/2007'
Mind that you might have to use CAST/CONVERT to explicitly handle the data type returned from the ".01 * your_column" calculation because you could be loosing precision depending on the column's data type.
UPDATE NomAntiguedad
SET <Column You're Updating> = .01*<Column You're Updating>
WHERE REPLACE(mesano, '/', '/01/') BETWEEN '5/1/2007' AND getDate()
I'm assuming you're date format is accurate and never changes.
精彩评论