Results 1 to 11 of 11

Thread: SQL Query

  1. #1
    Join Date
    Nov 2003
    Posts
    9

    Exclamation Unanswered: SQL Query

    I want to add months in my sql command line but in access, the sql command ADD_MONTHS doesnt work .. can anyone tell me any other command to work with... i am working on access 97 ...

    thanx in advance
    cheers,
    hunter

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Re: SQL Query

    Originally posted by hunter2000
    I want to add months in my sql command line but in access, the sql command ADD_MONTHS doesnt work .. can anyone tell me any other command to work with... i am working on access 97 ...

    thanx in advance
    cheers,
    hunter
    Use the function Month(anyDate)

    Month(Date) ----> gives 11
    Month(CDate("17/03/1999")) ------> gives 3

  3. #3
    Join Date
    Nov 2003
    Posts
    9
    hi

    thanx for the quick reply....

    sorry i needed to be clear, i am newbie in access 97, i went across a example where there is a due-date with the format 01-apr-02 and the due date is extnd over 2 months like 01-jun-02. how to do this ?

    thanx again...

    cheers,
    hunter

  4. #4
    Join Date
    Nov 2003
    Posts
    9

    Post

    HI

    i have tried Months(anyDate) and Months(CDate...) but it shows extnd by no of months and not in the actual format...

    could any one tell me how to get it.. ?

    this is table format..


    task orginail month extnd month

    jjj 01-apr-02 01-jun-02
    kkk 01-mai-02 01-jul-02
    ....

    cheers,
    hunter

  5. #5
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    What are you trying do to with this? What are you trying to accomplish?

  6. #6
    Join Date
    Nov 2003
    Posts
    9
    hi

    as i said before i am in the learning stage and i want to find out how to use the command, there is this example where there is a project and there are deadlines, if one of the project is extnd the list has to be revised... i hope i have cleared it now..

    sorry for any ambiguity...

    thanx again...

    cheers,
    hunter


    Originally posted by M Owen
    What are you trying do to with this? What are you trying to accomplish?

  7. #7
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Originally posted by hunter2000
    hi

    as i said before i am in the learning stage and i want to find out how to use the command, there is this example where there is a project and there are deadlines, if one of the project is extnd the list has to be revised... i hope i have cleared it now..

    sorry for any ambiguity...

    thanx again...

    cheers,
    hunter
    Sorry I can't understand
    if you can lookup MONTH in the help of Access perhaps it would help you.
    The function MONTH execludes the month (from 1 to 12) of any date sent to the function

  8. #8
    Join Date
    Nov 2003
    Posts
    9

    Talking

    i am sorry again... let me explain that examle...

    there is a project say XYZ and its deadline is 01-Apr-03. the table for that looks like this


    project start date end date

    XYZ 01-Apr-03 31-Apr-03


    Now the date is extened to another two months, say 30-Jun-03. Now the table should look like this

    project start date end date

    XYZ 01-Apr-03 30-Jun-03

    How to use the Month(anyDate) command to get this ?

    Hope I am clear now....

    thanx again,

    cheers,
    hunter



    Originally posted by hammbakka
    Sorry I can't understand
    if you can lookup MONTH in the help of Access perhaps it would help you.
    The function MONTH execludes the month (from 1 to 12) of any date sent to the function

  9. #9
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Where would you like to do that? Where should you enter the new date? on a Form?

    here is the update query

    UPDATE mainTab SET mainTab.endDate = #6/30/2003#
    WHERE (((mainTab.proj)="xyz"));

    I can send u a file in access 97 to see how can you update that date form the form.

  10. #10
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    If you use textbox on your form, so it should be like that

    UPDATE mainTab SET mainTab.endDate = [formulare]![F_upd_endDate]![txt_newDate] WHERE (((mainTab.proj)=[formulare]![F_upd_endDate]![txt_proj]));
    Attached Files Attached Files

  11. #11
    Join Date
    Nov 2003
    Posts
    9

    Thumbs up

    Originally posted by hammbakka
    If you use textbox on your form, so it should be like that

    UPDATE mainTab SET mainTab.endDate = [formulare]![F_upd_endDate]![txt_newDate] WHERE (((mainTab.proj)=[formulare]![F_upd_endDate]![txt_proj]));
    hi

    thanx that was gr8 help....

    cheers,
    hunter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •