Jump to content

Date confusion - what shall i use?


wilsonf1

Recommended Posts

Hi theremy website has a backoffice which im adding event details too - this will require me putting an event date in......on my home page i am selecting all from the back office and putting in a table, i would like to order by next event first.....this cant be too hard but date formats im useless with and dont even no what im googling to be honest - asp and sql dates are different so not massively sure what to do?i am using .mdb by the wayif some one could show me a bit of code that i use to put a date in my backoffice, and then what i use to select from the database - then fantastic and you are a star!!!other than that, my mini project is on hold :) !!!!cheeers

Link to comment
Share on other sites

What do you mean your website has a backoffice? Are you saying you are using a Microsoft BackOffice server? If you're using an Access database, check the Access manual or a reference online for which data types you have available to use.

Link to comment
Share on other sites

na its called backoffice from the companies i work with so i'll stick witt that hahaim now useing small date time which is cool and the order by is working great - the only thing i want to be able to do now is set a blank date if the next event is planned yet.now i had a go at leaving the database field empty, but when i tried an if statement saying: if date_time = "" or = null - basically it was always returning false...the only way i could get round it was set a default date for each row of 1/1/2007 and then say if date_time = "1/1/2001" Then date_time = "tba" ..... is that the only way i can manipulate it or can i ask if its blank...?

Link to comment
Share on other sites

[...] when i tried an if statement saying: if date_time = "" or = null - basically it was always returning false [...]
To test for Null in a database you usually don't use "=", since there is not considered to be any value present, and therefore there's nothing to compare with another value for equality. You normally have to use syntax such as "WHERE mydate IS NULL". Also I do seem to remember this is one of the areas where Access has its own syntax, and you may have to jump through hoops to make it work from a web client depending on the provider you're using etc. So unless someone posts further info about these aspects, you may need to do some googling to get it working,. But anyway, basically the idea is to check for "IS NULL" rather than "= NULL".
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...