Database dates (Access and SQL Server)
Ok, I have a date field in my Database, Modified_Date, which stores the date as 27/08/02 13:57:55.
If I wanted to select anything that had been changed since I last loaded, ie anything greater than 27/08/02 13:57:55 what would my SQL SELECT statement look like?
Code:
SELECT *
FROM tblTable
WHERE Modified_Date > This is the bit I can't work out...:(
I really should know it, but can't quite get it to work...
Anyone...
Call myself a pro VB Developer...*SIGH* Bad Woka *SLAP*
WhoeHaHaHaHa me helping the pro
Should i
ok try this
VB Code:
"SELECT *
FROM tblTable
WHERE Modified_Date >= #" & Format(start, "dd/mm/yy hh:mm:ss") & "#"
This is if u are sure it is stored in that format.
[EDIT]
You know start is a variable with a date in it
[/EDIT]
Slime on a rock makes for a great pudding...
Arrr...but if you do a Refresh on the collection, say 10 minutes later, then there may be a modified date that is greater :D
When I load my records into a collection I store the maximum Modified_Date field in a modular level varible, then when I do I refresh it only loads records that have been updated, quicker than loading the whole recordset again :)
I am using the Timestamp field type in SQL, but Access doesn't have this, no my DLL will not work if I point it towards an Access database. If, instead of a timestamp field, I use a Modified_Date field then this is easily transferable to Access or SQL Server...
Swatty - I take that as I compliment :p
Re: Slime on a rock makes for a great pudding...
Quote:
Originally posted by Wokawidget
Arrr...but if you do a Refresh on the collection, say 10 minutes later, then there may be a modified date that is greater :D
When I load my records into a collection I store the maximum Modified_Date field in a modular level varible, then when I do I refresh it only loads records that have been updated, quicker than loading the whole recordset again :)
I am using the Timestamp field type in SQL, but Access doesn't have this, no my DLL will not work if I point it towards an Access database. If, instead of a timestamp field, I use a Modified_Date field then this is easily transferable to Access or SQL Server...
Swatty - I take that as I compliment :p
you also have to remember that sql likes ' around a date while access like # around a date...
Circles in the sand implicate cake is on the way...
Which is correct...?
Code:
WHERE Modified_Date > '2002/08/27 13:57:55'
OR
Code:
WHERE Modified_Date > #2002/08/27 13:57:55#
Woka - having a crappy day - widget
Re: Circles in the sand implicate cake is on the way...
Quote:
Originally posted by Wokawidget
Which is correct...?
Code:
WHERE Modified_Date > '2002/08/27 13:57:55'
OR
Code:
WHERE Modified_Date > #2002/08/27 13:57:55#
Woka - having a crappy day - widget
read my post above this one :D
What a day , deffinitly having a nice we to come
Quote:
Originally posted by kleinma
WATCH THOSE N's!!!!!!
Could it be those were nanoseconds but don't they have to be put after the seconds ???
Which is correct...?
VB Code:
WHERE some_text like 'Woka Woka Woka said packm%'
OR
VB Code:
WHERE some_text like 'Woka Woka Woka said packm*'
All depends on the db your testing against