Jump to content

Date confusion - what shall i use?


wilsonf1
 Share

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...