Ciao.
E' possibile su un campo di tipo datetime
tipo questo per esempio :
selezionare i records che hanno2007-05-17 18:39:08
Y=2007
oppure
Y=2007+m=05
oppure
Y=2007+m=05+d=17
esempi chiarificatori sono assai graditi![]()
![]()
Ciao.
E' possibile su un campo di tipo datetime
tipo questo per esempio :
selezionare i records che hanno2007-05-17 18:39:08
Y=2007
oppure
Y=2007+m=05
oppure
Y=2007+m=05+d=17
esempi chiarificatori sono assai graditi![]()
![]()
Without faith, nothing is possible. With it, nothing is impossible
http://ilwebdifabio.it
Originariamente inviato da whisher
Ciao.
E' possibile su un campo di tipo datetime
tipo questo per esempio :
selezionare i records che hanno
Y=2007
oppure
Y=2007+m=05
oppure
Y=2007+m=05+d=17
esempi chiarificatori sono assai graditi![]()
codice:select * from tabella where year(campo_datetime) = 2007 select * from tabella where year(campo_datetime) = 2007 and month(campo_datetime) = 5 select * from tabella where year(campo_datetime) = 2007 and month(campo_datetime) = 5 and day(campo_datetime) = 17
edit.
ancora
per la data esatta
per anno e mesecodice:select * from tabella where date(campo_datetime) = '2007-05-17'
codice:select * from tabella where extract(year_month from campo_datetime) = '200705'
![]()
va bè non ci allarghiamo
![]()
![]()
Without faith, nothing is possible. With it, nothing is impossible
http://ilwebdifabio.it
Bè visto che + o - ci incastra
come passaresti i dati in GET
in questo modo
o?y=2007&m=05&d=17
nel secondo dovrai usare delle regex?d=20070517
o
altro ..............
Che ne pensi ?
![]()
Without faith, nothing is possible. With it, nothing is impossible
http://ilwebdifabio.it
Mah non saprei. In pratica devi passare come minimo l'anno e al massimo anno,mese e giorno, giusto?
Si giustissimo.Mah non saprei. In pratica devi passare come minimo l'anno e al massimo anno,mese e giorno, giusto?
Without faith, nothing is possible. With it, nothing is impossible
http://ilwebdifabio.it
Io userei il primo metodo, quello con i tre parametri ma aspettiamo pareri più autorevoli.![]()
Originariamente inviato da nicola75ss
Io userei il primo metodo, quello con i tre parametri ma aspettiamo pareri più autorevoli.
puoi fare anche solo anno, meseanno, giornopippeminuto, oramesegiornoannotantisaluti.....codice:?d=20070517 SELECT * FROM tabella WHERE date_format(campo_datetime, '%Y%m%d') = '$_GET[d]'
![]()
Il silenzio è spesso la cosa migliore. Pensa ... è gratis.
Originariamente inviato da piero.mac
puoi fare anche solo anno, meseanno, giornopippeminuto, oramesegiornoannotantisaluti.....codice:?d=20070517 SELECT * FROM tabella WHERE date_format(campo_datetime, '%Y%m%d') = '$_GET[d]'
![]()
pieroooooo.![]()
Originariamente inviato da nicola75ss
pieroooooo.![]()
Mi associo
![]()
Without faith, nothing is possible. With it, nothing is impossible
http://ilwebdifabio.it