Using the following SQL expression but I m getting an error.
select
CampaignCustomer.CampaignCustomerID,
convert(varchar, CampaignCustomer.ModifiedDate, 111) as startdate,
CampaignCustomer.CampaignID,
CampaignCustomer.CampaignCallStatusID,
CampaignCustomer.UserID,
CampaignCustomerSale.Value,
Users.Name
from CampaignCustomer
inner join CampaignCustomerSale
on CampaignCustomer.CampaignCustomerID = CampaignCustomerSale.CampaignCustomerID
inner join Users
on CampaignCustomer.UserID = Users.UserID
where
CampaignCustomer.CampaignCallStatusID = 21
and CampaignCustomer.startdate = 2011/11/22 <------- THIS
order by
startdate desc,
Users.Name asc
错误:
Msg 207, Level 16, State 1, Line 1
Invalid column name startdate .
我可以肯定一下WHERE条款中的“startdate
,但可在我的上查阅。 页: 1 什么错误?
Edit:
And no, it is not possible for me to change the datatype to date
instead of datetime
. The time is needed elsewhere. But in this case, I need only to get all posts on a specific date and I really don t care about what time of the date the modifieddate
is :)
或许还需要另一种方法而不是转换?