FCapo
asked on
Access Sql Date Vb
Hi,
I added a dateDiff to my sql statement:
I'm guessing it is because vb.net is trying to save the dateDiff column in to my database but there is no column to save to because it is created through the sql statement.
Is there a way around this?
I added a dateDiff to my sql statement:
dateDiff('d', recevDateBillSent, NOW()) AS DiffDate
My dataset is binding to my datagridview, this date difference field has been added as an extra column in my datagridview, but when I try to update other columns in my dataset there is a Concurrency violation: the UpdateCommand affected 0 of the expected 1 records.I'm guessing it is because vb.net is trying to save the dateDiff column in to my database but there is no column to save to because it is created through the sql statement.
Is there a way around this?
You can use templates for your update/edit that excludes the calculated value from your update command.
ASKER
I'm basically trying to filter only the records where a date is either smaller or equal then itself - 7 days.
for example :
recAccessBindingsource.Fil ter = "recevDateBillSent <= '%recevDateBillSent - 7%'"
but obviously this doesn't work, would there be a way to do this without using SQL?
for example :
recAccessBindingsource.Fil
but obviously this doesn't work, would there be a way to do this without using SQL?
Sql would be the place to apply the filter:
SELECT Table1.* FROM Table1 WHERE ((DateDiff("d",[The_Date_Field],Date())<=7));
Alan
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.