Я создал представление SQL Server и обновил представление, чтобы выбрать только часть даты без времени, и представление работает правильно на SQL сервере, я обновил модель из базы данных в диаграмме проекта, щелкнув по «Обновить модель из базы данных».
После обновления, когда я запускаю проект в браузере, его дата по-прежнему читается со временем, я удалил представление сервера SQL из диаграммы модели и добавил его снова, но все же когда запустите проект в браузере, он считывает дату со временем.
Нужно ли мне обновлять что-либо в самой Модели в Моделях или как решить эту проблему?
Это вид:
CREATE VIEW [dbo].[LAB_RESULTS_CLINIC_VIEW]
AS
SELECT DISTINCT
[LAB_RESULTS].ORDER_ID as 'order number',
labtests.TestId as 'Test Id',
labtests.TestName as 'Test Name'
,NORMAL_RESULT as 'Normal'
,cast(LAB_RESULTS.APPROVED_DATE as date) as 'Report Date'
,CASE WHEN coalesce([RESULT_NUMBER],'') <> '' THEN RESULT_NUMBER WHEN coalesce(RESULT_REPORT, '') <> '' THEN RESULT_REPORT END AS Result
,[RESULT_NOTE] as 'Notes'
,TestsRanges.LowerLimit as 'Low Range'
,TestsRanges.UpperLimit as 'High Range'
,TestsRanges.panic_value as 'Panic'
,TestsRanges.text_range as 'Text Range'
,machines.machine_name
,LAB_RESULTS.CUSTID as 'Customer No'
,Customers.CustName as 'Customer Name'
,LAB_RESULTS.patient_no as 'Patient No'
,Patients.PATIENT_NAME as 'Patient Name'
,Patients.PCfileNo as 'Clinic File No'
,patientcat.CatName as 'Category'
,Patients.Age AS 'AGE'
,gender.gendername as 'SEX'
,labtests.TestNotes as 'Test Note'
,TestsUnits.UnitName as 'UNIT'
,LAB_RESULTS.deptid AS 'DEPTID'
,cast(Lab_Hematology_Samples.COLLECTION_DATE as date) as 'Collection Date'
,cast(Lab_Hematology_Samples.RECEIVING_DATE as date) as 'Receiving Date'
,Groups.groupdesc as 'Group Name'
,LAB_RESULTS.SERIAL
,LAB_RESULTS.GROUPID
,LAB_RESULTS.packageid
,LAB_RESULTS.EXAMINED_BY
,LAB_RESULTS.APPROVED_BY
,UPDATED_BY
,UPDATED_DATE
,Lab_Result_Comments.comments as 'Comments'
,Departments.Dept_name as 'department name'
FROM [dbo].[LAB_RESULTS]
inner join LabTests on LabTests.testid=LAB_RESULTS.TESTID
inner join TestsRanges on LAB_RESULTS.TESTID=TestsRanges.TestId
inner join Departments on LAB_RESULTS.deptid=Departments.Dept_id
inner join PatientCat on patientcat.CatId = TestsRanges.CatId
inner join Customers on Customers.CustId=LAB_RESULTS.CUSTID
inner join patients on Patients.Patient_No = LAB_RESULTS.patient_no
inner join machines on lab_results.machine_id = machines.machine_id
inner join gender on gender.genderid = Patients.Gender
inner join TestsUnits on TestsUnits.UnitId = LabTests.UnitId
inner join Lab_Orders on Lab_Orders.ORDER_ID = LAB_RESULTS.ORDER_ID
left join Lab_Result_Comments on LAB_RESULTS.ORDER_ID = Lab_Result_Comments.ORDER_ID
inner join Lab_Hematology_Samples on Lab_Hematology_Samples.SAMPLE_ID = LAB_RESULTS.SAMPLE_ID
inner join Groups on (Groups.groupid = LAB_RESULTS.GROUPID and Groups.Testid = LAB_RESULTS.TESTID )
where (Lab_Orders.catid = TestsRanges.CatId or PatientCat.CatId =5)
and LAB_RESULTS.EXAMINED_DATE is not null
and LAB_RESULTS.APPROVED_DATE is not null
and LAB_RESULTS.SAMPLE_STATUS=6
and (Patients.Gender = TestsRanges.PatientSex or TestsRanges.PatientSex = 1 )
AND TestsRanges.machine_id = LAB_RESULTS.machine_id
-- and LAB_RESULTS.update_count in (select max(update_count) from LAB_RESULTS where SAMPLE_STATUS = 6 and deptid = @deptid and ORDER_ID = @ORDER_ID)
AND LAB_RESULTS.DEPTID IN (1,2,3,4)
UNION ALL
SELECT DISTINCT [LAB_RESULTS].ORDER_ID as 'order number'
,labtests.TestId as 'Test Id'
,labtests.TestName as 'Test Name'
,NORMAL_RESULT as 'Normal'
,cast(APPROVED_DATE as date) as 'Report Date'
,CASE WHEN coalesce([RESULT_NUMBER],'') <> '' THEN RESULT_NUMBER WHEN coalesce(RESULT_REPORT, '') <> '' THEN RESULT_REPORT END AS Result
,[RESULT_NOTE] as 'Notes'
,TestsRanges.LowerLimit as 'Low Range'
,TestsRanges.UpperLimit as 'High Range'
,TestsRanges.panic_value as 'Panic'
,TestsRanges.text_range as 'Text Range'
,machines.machine_name
,LAB_RESULTS.CUSTID as 'Customer No'
,Customers.CustName as 'Customer Name'
,LAB_RESULTS.patient_no as 'Patient No'
,Patients.PATIENT_NAME as 'Patient Name'
,Patients.PCfileNo as 'Clinic File No'
,patientcat.CatName as 'Category'
,Patients.Age AS 'AGE'
,gender.gendername as 'SEX'
,labtests.TestNotes as 'Test Note'
,TestsUnits.UnitName as 'UNIT'
,LAB_RESULTS.deptid AS 'DEPTID'
,cast(Lab_Hematology_Samples.COLLECTION_DATE as date) as 'Collection Date'
,cast(Lab_Hematology_Samples.RECEIVING_DATE as date)as 'Receiving Date'
,NULL AS 'Group Name'
,LAB_RESULTS.SERIAL
,LAB_RESULTS.GROUPID
,LAB_RESULTS.packageid
,LAB_RESULTS.EXAMINED_BY
,LAB_RESULTS.APPROVED_BY
,UPDATED_BY
,UPDATED_DATE
,Lab_Result_Comments.comments as 'Comments'
,Departments.Dept_name as 'department name'
FROM [dbo].[LAB_RESULTS]
inner join LabTests on LabTests.testid=LAB_RESULTS.TESTID
inner join TestsRanges on TestsRanges.TestId = LAB_RESULTS.TESTID
inner join Departments on LAB_RESULTS.deptid=Departments.Dept_id
inner join PatientCat on patientcat.CatId = TestsRanges.CatId
inner join Customers on Customers.CustId=LAB_RESULTS.CUSTID
inner join machines on lab_results.machine_id = machines.machine_id
inner join patients on Patients.Patient_No = LAB_RESULTS.patient_no
inner join gender on gender.genderid = Patients.Gender
inner join TestsUnits on TestsUnits.UnitId = LabTests.UnitId
left join Lab_Result_Comments on LAB_RESULTS.ORDER_ID = Lab_Result_Comments.ORDER_ID
inner join Lab_Orders on Lab_Orders.ORDER_ID = LAB_RESULTS.ORDER_ID
inner join Lab_Hematology_Samples on Lab_Hematology_Samples.SAMPLE_ID = LAB_RESULTS.SAMPLE_ID
where (Lab_Orders.catid = TestsRanges.CatId or PatientCat.CatId =5)
and LAB_RESULTS.EXAMINED_DATE is not null
and LAB_RESULTS.APPROVED_DATE is not null
and LAB_RESULTS.SAMPLE_STATUS=6
and (Patients.Gender = TestsRanges.PatientSex or TestsRanges.PatientSex = 1 )
and LAB_RESULTS.GROUPID = 0
-- and LAB_RESULTS.update_count in (select max(update_count) from LAB_RESULTS where SAMPLE_STATUS = 6 and deptid = @deptid and ORDER_ID = @ORDER_ID)
-- and LAB_RESULTS.deptid = @deptid
AND TestsRanges.machine_id = LAB_RESULTS.machine_id
AND LAB_RESULTS.DEPTID IN (1,2,3,4)
GO
это моя дата поля обновлены, чтобы выбрать только часть даты и работать правильно и дата отчета появилась дата + время: