| Author |
Topic |
|
Tiger
Starting Member
5 Posts |
Posted - 2006-03-19 : 12:24:33
|
Okay, 2 questions here.First I want to query everyone with a date greater than today in the field EXPIRATION DATE. I know I can say > 2006-03-19 but I always want it to be TODAY.Next, Is there a system field that I can search for the date a record was last updated?? I make frequent changes, and I want others to see what date a record was last updated. If not, can I tell the system to mark a field "YES" when I make changes?I use phpmyadmin. I do not have server access, just through PHP.Thanks!TV ...The TIger has ROARED |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-03-19 : 12:28:23
|
1. today = getdate()2. no there isn't. if you want that functionality you have to add the column last_updated in your tables and update it eiter with a trigger or in a sproc that you use for accessing data.Go with the flow & have fun! Else fight the flow |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-03-20 : 00:19:01
|
| 1 Select columns from yourTable where datecol>DateAdd(day,Datediff(day,0,getdate()),0)MadhivananFailing to plan is Planning to fail |
 |
|
|
Tiger
Starting Member
5 Posts |
Posted - 2006-03-20 : 22:49:52
|
| SELECT * FROM `MTIA` WHERE `Expires` >DateAdd(day,Datediff(day,0,getdate()),0)Gets me nothing. I tried putting 'dateadd....' and get nothing. :-( Sorry, I'm SQLtupid. :-/...The TIger has ROARED |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-03-20 : 22:53:38
|
does this return anything ?select * from MTIA where Expires > '20060319' KHChoice is an illusion, created between those with power, and those without.Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant |
 |
|
|
Tiger
Starting Member
5 Posts |
Posted - 2006-03-21 : 00:39:29
|
| Select * from MTIA where Expires>DateAdd(day,Datediff(day,0,getdate()),0)SQL query: SELECT * FROM MTIAWHERE `Expires` > DateAdd(DAY , Datediff(DAY , 0, getdate()), 0)MySQL said: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '( day , Datediff ( day , 0 , getdate ( ) ) , 0 ) LIMIT 0, 30' a ...The TIger has ROARED |
 |
|
|
Tiger
Starting Member
5 Posts |
Posted - 2006-03-21 : 00:40:28
|
| does this return anything ?select * from MTIA where Expires > '20060319'Gives me just what I want! But only til midnight. :-)...The TIger has ROARED |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-03-21 : 00:57:23
|
| >>MySQL said: Do you use MySQL?This is for SQL Server.MadhivananFailing to plan is Planning to fail |
 |
|
|
Tiger
Starting Member
5 Posts |
Posted - 2006-03-21 : 05:54:03
|
| I use phpmyadmin. I do not have server access, just through PHP.It is MySQL in the background...The TIger has ROARED |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-03-21 : 05:56:54
|
well this sql server forum... so not many people have worked with mysql have you tried dbforums?http://www.dbforums.com/f5Go with the flow & have fun! Else fight the flow |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-03-21 : 06:48:33
|
| Also try at www.Mysql.comMadhivananFailing to plan is Planning to fail |
 |
|
|
|