Day of Week

I'm writing a database application that accepts two weekdays (Monday, Tuesday, Wednesday, etc) edits data using both; I can retreive the information fine, i.e.

[code]
select datename(dw,date) as 'Day of Week', *
from meetingtime
[/code]

But once I had loaded all of this into data structures, made the changes I'd like, I don't know how to put it back, this is because I dont know how to say let date =

A simple example would be that I wanted to change all occurences of 'Monday' in the table to 'Wednesday'

Any ideas?

Comments

  • : I'm writing a database application that accepts two weekdays
    : (Monday, Tuesday, Wednesday, etc) edits data using both; I can
    : retreive the information fine, i.e.
    :
    : [code]:
    : select datename(dw,date) as 'Day of Week', *
    : from meetingtime
    : [/code]:
    :
    : But once I had loaded all of this into data structures, made the
    : changes I'd like, I don't know how to put it back, this is because I
    : dont know how to say let date =
    :
    : A simple example would be that I wanted to change all occurences of
    : 'Monday' in the table to 'Wednesday'
    :
    : Any ideas?
    :


    what if you had two fields, one for the actual date and one for the weekday. would be easy to query for a specific weekday.
    [could also use the Format(date,"w") func. to determine the weekday]

    then to change occurrences need to add/subtract the difference between the weekday. ie: 10/15/07 Mon would become 10/17/07 by adding "2" days

    Dim dt1 As Date
    Dim dt2 As Date

    dt1 = CDate("10/15/2007")
    'switch monday to wednesday by adding 2 days
    dt2 = dt1 + 2
    MsgBox dt2
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion