你好我想在日期時間數據類型在sql server中保存一個日期。在搜索屏幕中,我將參數作爲唯一的日期。如何獲取數據庫日期時間值僅作爲日期?
那麼我該如何設置查詢?我的代碼是:
<asp:SqlDataSource
ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:TAXIConnectionString %>"
SelectCommand="SELECT [TripId] FROM [BookingMaster]
WHERE (([PickupDateTime] = @PickupDateTime or @PickupDateTime is null))"
CancelSelectOnNullParameter="False">
<SelectParameters>
<asp:ControlParameter ControlID="txtBookingDate"
Name="PickupDateTime" PropertyName="Text" Type="String"
ConvertEmptyStringToNull="true" />
</SelectParameters>
</asp:SqlDataSource>
+1對'提前幫助我' – phadaphunk 2013-05-06 17:17:52
您使用的是哪種DB提供程序? – mclark1129 2013-05-06 17:21:37
sql server數據庫 – Saranya 2013-05-06 17:23:41