J Jimmy New member Local time Today, 16:03 Joined Sep 13, 2004 Messages 6 Sep 13, 2004 #1 Hi everyone, dateadd("d",-1,date()) this doesn't work dateadd("d",-1,#13-9-2004#) this works great But i need the first solution. I always need the date of yesterday Can somebody help me!!
Hi everyone, dateadd("d",-1,date()) this doesn't work dateadd("d",-1,#13-9-2004#) this works great But i need the first solution. I always need the date of yesterday Can somebody help me!!
A adaytay Not your typical IT Geek! Local time Today, 15:03 Joined May 14, 2004 Messages 16 Sep 13, 2004 #2 Jimmy said: Hi everyone, dateadd("d",-1,date()) this doesn't work dateadd("d",-1,#13-9-2004#) this works great But i need the first solution. I always need the date of yesterday Can somebody help me!! Click to expand... Try being a little more expressive, and storing Date() in a variable before passing through to DateAdd. Something like: Code: Dim dtDate as Date dtDate=Date() DateAdd("d", -1, dtDate) This is untested, but should work... Ad
Jimmy said: Hi everyone, dateadd("d",-1,date()) this doesn't work dateadd("d",-1,#13-9-2004#) this works great But i need the first solution. I always need the date of yesterday Can somebody help me!! Click to expand... Try being a little more expressive, and storing Date() in a variable before passing through to DateAdd. Something like: Code: Dim dtDate as Date dtDate=Date() DateAdd("d", -1, dtDate) This is untested, but should work... Ad
R Rich Guest Sep 13, 2004 #3 Where are you using it? there are no brackets after Date in vba, it's just Date
R ray705 Registered User. Local time Today, 09:03 Joined Feb 3, 2003 Messages 45 Sep 13, 2004 #4 I just tried your format on a form linked to a command button. Worked perfectly. How are you trying to use it?
I just tried your format on a form linked to a command button. Worked perfectly. How are you trying to use it?
E ecniv Access Developer Local time Today, 15:03 Joined Aug 16, 2004 Messages 229 Sep 13, 2004 #5 dateadd("d",-1,now)
R Rich Guest Sep 14, 2004 #6 ecniv said: dateadd("d",-1,now) Click to expand... Now will add a time element into the equation and give inconsistent results, Date is correct, if it isn't working then Jimmy almost certainly has a missing reference
ecniv said: dateadd("d",-1,now) Click to expand... Now will add a time element into the equation and give inconsistent results, Date is correct, if it isn't working then Jimmy almost certainly has a missing reference
J Jimmy New member Local time Today, 16:03 Joined Sep 13, 2004 Messages 6 Sep 14, 2004 #7 Thx ADAYTAY you were right, pretty obvious strange that date() doesn't return a date-obeject. Thank you all for you replies (Y) adios
Thx ADAYTAY you were right, pretty obvious strange that date() doesn't return a date-obeject. Thank you all for you replies (Y) adios
R Rich Guest Sep 14, 2004 #8 Jimmy said: strange that date() doesn't return a date-obeject. adios Click to expand... it does, like I said, without the brackets
Jimmy said: strange that date() doesn't return a date-obeject. adios Click to expand... it does, like I said, without the brackets