You are here: Re: Help with a query please !! It works but needs adjusting ! « PHP SQL « IT news, forums, messages
Re: Help with a query please !! It works but needs adjusting !

Posted by jerryyang_la1 on 10/09/11 11:58

jerryyang_la1@yahoo.com wrote:

> > I really don't know the syntax, dbms or system you are using, but the
> > following is consistent with your example and performs the required
> > logic. You didn't ask (or show DDL etc.) but from your example and
> > requirements your database table is far from 1NF and needs looking at.
> >
> > "SELECT * FROM tbl" &_
> > "WHERE ( CDATE(Date) = #" & dtOnDay &
> > "# OR Date2 = #" & dtOnDay &
> > "# OR Date3 = #" & dtOnDay &
> > "# OR Date4 = #" & dtOnDay &
> > "# OR Date5 = #" & dtOnDay &
> > "# OR Date6 = #" & dtOnDay &
> > "# OR Date7 = #" & dtOnDay &
> > "# )" &
> > "AND ( userID = #" & SearchedUsername &
> > "# OR userID2 = #" SearchedUsername &
> > "# )
>
Thanks it worked I just needed to amend it as follows:
Ie:

"AND ( userID = '" & SearchedUsername &
"' OR userID2 = '" SearchedUsername &
"' )"

Nore the ' I have added !

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация