SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,834 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello, when previewing the data table to send to excel, I get the error, this is my code:
DECLARE @YA AS DATETIME = GETDATE()
SELECT DATEPART(ISO_WEEK, @YA)
SELECT * FROM Datos.dbo.RegistroDeEntradas
WHERE DATEPART(ISO_WEEK, @YA) = NoSem
ORDER BY Fecha ASC
I'm trying to select just the data with the same number as the number of the week.
Try removing this line:
*SELECT DATEPART(ISO_WEEK, *@YA)
However, if you really need it, then add a name:
*SELECT DATEPART(ISO_WEEK, *@YA) as IsoWeek