SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Jul 2006
    Location
    Chennai-India
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    SQL date comparison

    hi all,

    i want 2 campare two dates in sql. i.e comparing sysdate with the date driven from database. actually i am having date field in my database and i want 2 get the datas in which date should be 14 days less than sysdate.

    reply me
    regards
    raichur

  2. #2
    Moderator
    Join Date
    Mar 2002
    Location
    Tampa Bay
    Posts
    7,673
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: SQL date comparison

    Compare how? (Pure) SQL isn't a programming language - it's a query language. It (depending on whose implementation you are using) has some ability to make comparisons (such as in a WHILE clause).

    But the exact method of implementing "WHILE such-and-such-a-date-column IS LESS THAN sysdate-14" (if that's what you want) depends on a lot of things you haven't told us.

  3. #3
    Senior Member
    Join Date
    Apr 2006
    Location
    ked up until rehabilitated
    Posts
    515
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: SQL date comparison

    I thought this was going to be something along the lines of:

    "I have a bunch of girls that I have dated, and I want to store the results of the dates in SQL.

    Does anyone know what would be a good Primary Key for them? Some of the girls have been on more than one date with me, so I think I need some kind of relationship, but I don't want to get into a commitment. Also, I have never had a chance at a one to many relationship before, can any of you guys reccommend it?"

    Now that would be an SQL Date Comparison I would like to see the results of. [img]images/icons/smile.gif[/img]
    Aaron Fager
    Software Test Engineer

    If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization.

  4. #4
    Senior Member
    Join Date
    Feb 2003
    Location
    FL, USA
    Posts
    3,646
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: SQL date comparison

    Is this what we call Black Book SQL?
    Lynne

    I have not failed. I've just found 10,000 ways that won't work" --Thomas Edison

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 09:16 AM.

Copyright BetaSoft Inc.