Retrieve data by moth or day or year (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


box -> Retrieve data by moth or day or year (1/30/2008 2:27:51)

mydate is my field "Text" that keep the date with the following format mm/dd/yyyy. How can I retrieve data by moth or day or year only? Or should I create a separate field for day, month and year? I’m using DWR, any idea please?

fp_sQry="SELECT * FROM ptinfo WHERE (mydate = #::mydate::#)"




matthewm -> RE: Retrieve data by moth or day or year (1/30/2008 2:45:03)

Does the field need to be of type text?
What SQL DB are you using? If it is MS SQL, you could use the datetime field and refer to http://www.simple-talk.com/sql/learn-sql-server/robyn-pages-sql-server-datetime-workbench/ for how to manipulate dates (great resource).

If the DB is something like MySQL then you could always look at using EPOCH time which is very easy to manipulate, Google would be able to assist in finding a resource on converting EPOCH to human readable and building quries etc.

If im off track let me know and I will do what I can to assist.

Thanks,

matt




box -> RE: Retrieve data by moth or day or year (1/30/2008 17:24:37)

Thanks 4 reply, I use access MS,




matthewm -> RE: Retrieve data by moth or day or year (1/30/2008 19:55:35)

I havent used MS Access for a while and dont have Access on my work PC, so I hope this is correct and isnt leading you up the garden path.

I found this KB article on the MS site which looks helpfull:
http://support.microsoft.com/kb/210276

There is also this forum post (see down the bottom):
http://www.experts-exchange.com/Database/Miscellaneous/Q_21242218.html

Hopefully these two sites assist in what you are after.

Good luck!

Matt




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.03125