borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Combobox anomalies)Next Topic (How to retrieve file info) New Topic New Poll Post Reply
AndreaVB Forum : VB General : mm/dd/yy date problem
Poster Message
abhijeetpappu
Level: Guest


icon mm/dd/yy date problem

hi

i am having a date problem in vb. i am using access as database.
i am using dd/mm/yy format in my project.but in access date are stored in mm/dd/yy format.

my database structure is like this-
filename  text
start_dt  date
end_dt    date

if i provide a date then according to logic it checks like this

if strdate >=start_dt and strdate <=end_dt then
    show filename
end if

but this code is not working
someone please help me.

30-10-2002 at 09:15 AM
| Quote Reply
Harrism
Level: Guest

icon Re: mm/dd/yy date problem

Check your regional settings
sounds like they are not british english.

Put the date in rs.fields("Start_dt") = format(now,"dd/mm/yyyy")
will work but when you retrieve the data access thinks it is formatted "mm/dd/yyyy"

so the 1st of may input would be retrieved as the 5th of january

I'll get back as soon as ive checked this

30-10-2002 at 10:57 AM
| Quote Reply
Harrism
Level: Guest

icon Re: mm/dd/yy date problem

just checked it and that would seem to be youre prob.

Happy Hunting

30-10-2002 at 11:08 AM
| Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: mm/dd/yy date problem

(For future programs),

I've always found entering and storing the date in the full longer format better (ie: Jan 01 2002). That way there's no problem telling which is which, no matter what order they're in.

Especially when dealiing with numerous date formats (over 10) in one building of users. Especially when Access had an interesting habit of changing the date structure when opened on the different PC's and storing the dates in different formats based on the user's preferences. Values stored by one user (by opening the Access DB directly) showed up on every else's PC as being entered in 1906.


30-10-2002 at 04:15 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : VB General : mm/dd/yy date problem
Previous Topic (Combobox anomalies)Next Topic (How to retrieve file info) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder