SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru ujjwal's Avatar
    Join Date
    Oct 2004
    Location
    kolkata
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sql problem,Help needed

    Hi All,
    I haven't get any suitable answer so i posting it in here.
    My problem is I want to search customer name on the respect of customer last name and date(selecting month and year only not date).but in database i have an date field weddate which has actual date.How to write the sql query?
    Could you guide me?
    I have posting what i have done it:
    SELECT * FROM `user_wedding` where blname='$glname' and weddate='$year-$mon-__'
    The actual date is not given by user.He given the name of the month and year only. my query would be depend on the name of the month and year.
    what is the actuall sql statement?

  2. #2
    Non-Member Icheb's Avatar
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    1,474
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A SQL question would probably be better suited in the SQL forums .

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,270
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    icheb, this is the sql forum

    Code:
    SELECT * FROM `user_wedding` 
     where blname='$glname' 
       and weddate >= firstofthemonth 
       and weddate < firstdayofnextmonth
    ujjwal, what database is this? because the values will differ depending on which one it is
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

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