Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default add 1 day to date variable

Hello, hopefully somebody can help me,

I'm retrieving 2 records from an Access table, a start date and a due date.
I'd like to retrieve a 3rd record, which would be the start date + 1.
However, the following doesn't work:

st = DatePart("d", rs.Fields("tasks.task_ass_date"))
due = DatePart("d", rs.Fields("task_ddate"))
next = st + 1

It gives me a compile error: expected: variable.

Does anyone have any suggestions? Thanks in advance for any help,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default add 1 day to date variable

Dave Try this
st = DatePart("d", rs.Fields("tasks.task_ass_date")) + 1
due = DatePart("d", rs.Fields("task_ddate"))
"DaveMZ" wrote:

Hello, hopefully somebody can help me,

I'm retrieving 2 records from an Access table, a start date and a due date.
I'd like to retrieve a 3rd record, which would be the start date + 1.
However, the following doesn't work:

st = DatePart("d", rs.Fields("tasks.task_ass_date"))
due = DatePart("d", rs.Fields("task_ddate"))
next = st + 1

It gives me a compile error: expected: variable.

Does anyone have any suggestions? Thanks in advance for any help,

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA/SQL date variable problem Will[_8_] Excel Programming 0 August 18th 05 12:03 PM
Setting a Date variable scott Excel Programming 4 January 28th 05 01:12 AM
Assign a Date Variable within VBA Q John Excel Programming 9 December 21st 04 04:46 PM
calc constant date from variable date & return with ability to rn. SusieQ'sQuest Excel Worksheet Functions 1 November 9th 04 08:51 PM
Compare Date in Cell VS a Variable Date to Hide Row JimI Excel Programming 3 October 10th 04 04:26 PM


All times are GMT +1. The time now is 08:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"