Ich habe die unten gespeicherte Prozedur, aber das Problem, das ich habe, ist, dass C1 Einreichungsdatum, C2 Einreichungsdatum, C3 Einreichungsdatum, C4 Einreichungsdatum als MM/DD/YYYY angezeigt wird und Zeit zeigt. Ich möchte nur, dass es UK Datumformat zeigt DD/MM/YYDatum in UK-Format in MSReport konvertieren?
Ich denke, ich muss dies als Datum konvertieren? Bitte informieren Sie mich und sehen Sie meine SQL-Abfrage.
USE [Drop2_MSCRM]
GO
/****** Object: StoredProcedure [dbo].[spMIClientServicesReport] Script Date: 16/06/2017 16:17:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[spMIClientServicesReport]
@FromDate date,
@ToDate date
AS
BEGIN
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SELECT CL_Reg_Number,
Name,
Supplier_Status,
Achieved_Product_Level,
Target_Product_Level,
Primary_Contact,
Email,
Telephone,
Line1,
Line2,
Line3,
Line4,
City,
County,
Postcode,
SignUp_Date,
dbo.fn_GetSectionStatus(AccountId, N'C1') AS C1_Status,
dbo.fn_GetSectionDates(AccountId, N'C1') AS C1_Submission_Date,
dbo.fn_GetSectionStatus(AccountId, N'C2') AS C2_Status,
dbo.fn_GetSectionDates(AccountId, N'C2') AS C2_Submission_Date,
dbo.fn_GetSectionStatus(AccountId, N'C3') AS C3_Status,
dbo.fn_GetSectionDates(AccountId, N'C3') AS C3_Submission_Date,
dbo.fn_GetSectionStatus(AccountId, N'C4') AS C4_Status,
dbo.fn_GetSectionDates(AccountId, N'C4') AS C4_Submission_Date,
dbo.fn_GetSectionStatus(AccountId, N'O1') AS O1_Status,
dbo.fn_GetSectionDates(AccountId, N'O1') AS O1_Submission_Date,
dbo.fn_GetSectionStatus(AccountId, N'O2') AS O2_Status,
dbo.fn_GetSectionDates(AccountId, N'O2') AS O2_Submission_Date,
dbo.fn_GetSectionStatus(AccountId, N'O3') AS O3_Status,
dbo.fn_GetSectionDates(AccountId, N'O3') AS O3_Submission_Date,
dbo.fn_GetSectionStatus(AccountId, N'O4') AS O4_Status,
dbo.fn_GetSectionDates(AccountId, N'O4') AS O4_Submission_Date,
dbo.fn_GetSectionStatus(AccountId, N'L3') AS Supplementary_Questions_Status,
dbo.fn_GetSectionDates(AccountId, N'L3') AS Supplementary_Questions_Submission_Date,
dbo.fn_GetSectionStatus(AccountId, N'L4') AS OAR_Status,
dbo.fn_GetSectionDates(AccountId, N'L4') AS OAR_Submission_Date
FROM(
SELECT acc.AccountId AS AccountID,
acc.mm_registrationnumber AS CL_Reg_Number,
acc.Name,
mm_supplierstatusname AS Supplier_Status,
mm_catalogitemtoorganisationlinker2.mm_achievedcatalogproductName AS Achieved_Product_Level,
mm_catalogitemtoorganisationlinker2.mm_catalogitemName AS Target_Product_Level,
acc.PrimaryContactIdName AS Primary_Contact,
acc.EMailAddress1 AS Email,
acc.Telephone1 AS Telephone,
adr.mm_line1 AS Line1,
adr.mm_line2 AS Line2,
adr.mm_line3 AS Line3,
adr.mm_line4 AS Line4,
adr.mm_city AS City,
adr.mm_county AS County,
adr.mm_postcode AS Postcode,
CONVERT(VARCHAR(10), acc.mm_signupdate, 103) AS SignUp_Date
FROM FilteredAccount AS acc
OUTER APPLY
(
SELECT TOP 1 mm_achievedcatalogproductName, mm_catalogitemName
FROM mm_catalogitemtoorganisationlinker
WHERE mm_catalogitemtoorganisationlinker.[mm_organisation] = acc.accountid
ORDER BY CASE when mm_achievedcatalogproductName is null THEN 1 ELSE 0 END, mm_achievedcatalogproductName DESC
)
mm_catalogitemtoorganisationlinker2 LEFT JOIN mm_address AS adr ON acc.mm_address = adr.mm_addressId
WHERE (acc.mm_registrationnumber IS NOT NULL) AND Cast (Acc.mm_signupdate as DATE) BETWEEN @FromDate AND @ToDate) CSR ORDER BY CL_Reg_Number
END