将“2016-01-17 00:00:00:”变成简单的“1月”(等等)最简单的方法是什么?
SELECT
VendorName,
Invoices.InvoiceNumber,
Invoices.InvoiceDueDate AS InvoiceMonth
FROM
Vendors,
Invoices
WHERE
Vendors.VendorID = Invoices.VendorID;
Here is what I am attempting to get from executing in SQL Server:
答案 0 :(得分:0)
似乎有点混乱
SELECT
VendorName,
Invoices.InvoiceNumber,
DateName(MONTH,Invoices.InvoiceDueDate) AS InvoiceMonth
FROM
Vendors,
Invoices
WHERE
Vendors.VendorID = Invoices.VendorID;
要启动,JOIN应该看起来像这样
From Vendors
Join Invoices on Vendors.VendorID = Invoices.VendorID