For this,
we need to write a query in Query designer.
Ex:
SELECT CreatedByName, OwnerIdName, ActivityTypeCode, CreatedOn, Subject, ServiceIdName, ActivityId
FROM ActivityPointer
WHERE (CONVERT(varchar, CreatedOn, 103) = CONVERT(varchar, GETDATE(), 103))
here :
Today report
WHERE (CONVERT(varchar, CreatedOn, 103) = CONVERT(varchar, GETDATE(), 103))
is the logic for getting records from current date.
Yesterday report
WHERE (CONVERT(varchar, createdon, 103) = CONVERT(varchar, GETDATE() - 1, 103))
for Weekly Report:
WHERE (DATEPART(week, createdon) = DATEPART(week, GETDATE()) - 1)
for monthly report
WHERE (DATEPART(month, createdon) = DATEPART(month, GETDATE())-1)
Removing Seconds from Date and Time:
SELECT CONVERT(VARCHAR,scheduledstart,101) +
RIGHT (CONVERT(VARCHAR,scheduledstart , 100 ) ,7)
this will give the result: mm/dd/yy hh:mm am/pm
Getting only Date:
=FormatDateTime(Fields!scheduledend.Value,DateFormat.ShortDate)
Formating time : Removing Seconds from the time:
(SELECT CONVERT(VARCHAR, FilteredAppointment.scheduledstart, 101) + ' ' + RIGHT(CONVERT(VARCHAR, FilteredAppointment.scheduledstart, 100), 7) AS Expr1)
AS scheduledstart
this is the logic.
where we need to place it.
Example:
in query builder. Query looks like.
select new_name, (SELECT CONVERT(VARCHAR, FilteredAppointment.scheduledstart, 101) + ' ' + RIGHT(CONVERT(VARCHAR, FilteredAppointment.scheduledstart, 100), 7) AS Expr1)
AS scheduledstart from FilteredAppointment
WHERE (CONVERT(varchar, createdon, 103) >= CONVERT(varchar, GETDATE() - 5, 103))
then we will get the week data.
we need to write a query in Query designer.
Ex:
SELECT CreatedByName, OwnerIdName, ActivityTypeCode, CreatedOn, Subject, ServiceIdName, ActivityId
FROM ActivityPointer
WHERE (CONVERT(varchar, CreatedOn, 103) = CONVERT(varchar, GETDATE(), 103))
here :
Today report
WHERE (CONVERT(varchar, CreatedOn, 103) = CONVERT(varchar, GETDATE(), 103))
is the logic for getting records from current date.
Yesterday report
WHERE (CONVERT(varchar, createdon, 103) = CONVERT(varchar, GETDATE() - 1, 103))
for Weekly Report:
WHERE (DATEPART(week, createdon) = DATEPART(week, GETDATE()) - 1)
for monthly report
WHERE (DATEPART(month, createdon) = DATEPART(month, GETDATE())-1)
Removing Seconds from Date and Time:
SELECT CONVERT(VARCHAR,scheduledstart,101) +
RIGHT (CONVERT(VARCHAR,scheduledstart , 100 ) ,7)
this will give the result: mm/dd/yy hh:mm am/pm
Getting only Date:
=FormatDateTime(Fields!scheduledend.Value,DateFormat.ShortDate)
Formating time : Removing Seconds from the time:
(SELECT CONVERT(VARCHAR, FilteredAppointment.scheduledstart, 101) + ' ' + RIGHT(CONVERT(VARCHAR, FilteredAppointment.scheduledstart, 100), 7) AS Expr1)
AS scheduledstart
this is the logic.
where we need to place it.
Example:
in query builder. Query looks like.
select new_name, (SELECT CONVERT(VARCHAR, FilteredAppointment.scheduledstart, 101) + ' ' + RIGHT(CONVERT(VARCHAR, FilteredAppointment.scheduledstart, 100), 7) AS Expr1)
AS scheduledstart from FilteredAppointment
WHERE (CONVERT(varchar, createdon, 103) >= CONVERT(varchar, GETDATE() - 5, 103))
then we will get the week data.
No comments:
Post a Comment