M
Magus
How do I calculate all fields for column X and display the difference in column Y for each row?
I have a column (date) named DateEntered. I want to take that and use DATEDIFF() for todays date and display how old each one is.
I'm currently using: dAdapter = new OleDbDataAdapter("SELECT JobName, Location, JobType, DateEntered, DaysOld FROM pIndex", con);
I've tried using this:
"SELECT JobName, Location, JobType, DateEntered, DATEDIFF('day',DateEntered,Date()) AS DaysOld FROM pIndex"
That doesn't work either. I'm new to databases and probably going about this entirely wrong. Hopefully someone can help point me in the right direction.
Oh. I'm using an MS Access database (mdb). My connection string is "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=database.mdb;";
Here is the error I receive when I try to fill my dataset using DATEDIFF:
"The provider could not determine the Int32 value. For example, the row was just created, the default for the Int32 column was not available, and the consumer had not yet set a new Int32 value."
Any help would be greatly appreciated.
I have a column (date) named DateEntered. I want to take that and use DATEDIFF() for todays date and display how old each one is.
I'm currently using: dAdapter = new OleDbDataAdapter("SELECT JobName, Location, JobType, DateEntered, DaysOld FROM pIndex", con);
I've tried using this:
"SELECT JobName, Location, JobType, DateEntered, DATEDIFF('day',DateEntered,Date()) AS DaysOld FROM pIndex"
That doesn't work either. I'm new to databases and probably going about this entirely wrong. Hopefully someone can help point me in the right direction.
Oh. I'm using an MS Access database (mdb). My connection string is "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=database.mdb;";
Here is the error I receive when I try to fill my dataset using DATEDIFF:
"The provider could not determine the Int32 value. For example, the row was just created, the default for the Int32 column was not available, and the consumer had not yet set a new Int32 value."
Any help would be greatly appreciated.