T
Tony K
I have a form that involves a datagrid view to be filled after a start and
end date are selected from 2 DateTimePicker fields using the Short Format.
The query works without error but...
I have records to be returned that have dates such as 5/14/2008 and when the
start date is selected as 5/14/2008 the query doesn't include it unless I
select 5/13/2008.
I'm guessing this has to do with the time?? Is there a way to have it
ignore the time or make it the date + 12:00:00AM??
code:
Try
Me.TotalsTableAdapter.FillPOTotalByDate(Me.Inventory_management_databaseDataSet.Totals,
New System.Nullable(Of Date)(CType(StartDateTimePicker.Value, Date)), New
System.Nullable(Of Date)(CType(StopDateTimePicker.Value, Date)))
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
query:
SELECT [Purchase Orders].OrderDate, [Purchase
Orders].PurchaseOrderNumber, Suppliers.SupplierName, SUM([Inventory
Transactions].UnitPrice)
AS [Sum Of UnitPrice]
FROM (([Purchase Orders] INNER JOIN
Suppliers ON [Purchase Orders].SupplierID =
Suppliers.SupplierID) INNER JOIN
[Inventory Transactions] ON [Purchase
Orders].PurchaseOrderID = [Inventory Transactions].PurchaseOrderID)
WHERE ([Purchase Orders].OrderDate >= ?) AND ([Purchase
Orders].OrderDate <= ?)
GROUP BY [Purchase Orders].OrderDate, [Purchase Orders].PurchaseOrderNumber,
Suppliers.SupplierName
Thank you,
Tony K
end date are selected from 2 DateTimePicker fields using the Short Format.
The query works without error but...
I have records to be returned that have dates such as 5/14/2008 and when the
start date is selected as 5/14/2008 the query doesn't include it unless I
select 5/13/2008.
I'm guessing this has to do with the time?? Is there a way to have it
ignore the time or make it the date + 12:00:00AM??
code:
Try
Me.TotalsTableAdapter.FillPOTotalByDate(Me.Inventory_management_databaseDataSet.Totals,
New System.Nullable(Of Date)(CType(StartDateTimePicker.Value, Date)), New
System.Nullable(Of Date)(CType(StopDateTimePicker.Value, Date)))
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
query:
SELECT [Purchase Orders].OrderDate, [Purchase
Orders].PurchaseOrderNumber, Suppliers.SupplierName, SUM([Inventory
Transactions].UnitPrice)
AS [Sum Of UnitPrice]
FROM (([Purchase Orders] INNER JOIN
Suppliers ON [Purchase Orders].SupplierID =
Suppliers.SupplierID) INNER JOIN
[Inventory Transactions] ON [Purchase
Orders].PurchaseOrderID = [Inventory Transactions].PurchaseOrderID)
WHERE ([Purchase Orders].OrderDate >= ?) AND ([Purchase
Orders].OrderDate <= ?)
GROUP BY [Purchase Orders].OrderDate, [Purchase Orders].PurchaseOrderNumber,
Suppliers.SupplierName
Thank you,
Tony K