Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Am I using correct string to get the results ending within a week.
Old 05-13-2010, 01:41 AM Am I using correct string to get the results ending within a week.
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Hi,

I am trying to fetch the records ending within this week...so I made a query string this.....

HTML Code:
select * from bcc join business b on bcc.bizbcc_biz_id = b.biz_id join city c on bcc.bizbcc_city_id = c.city_id where bizbcc_enddate regexp '.*[05]\/.*' and bizbcc_enddate regexp '.*\/[13-7]\.*' and bizbcc_enddate regexp '.\/*2010.*'
But its not giving relevant results....

Any expert comments would be appreciated.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-13-2010, 02:18 AM Re: Am I using correct string to get the results ending within a week.
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
What're the field types?
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 05-13-2010, 06:13 AM Re: Am I using correct string to get the results ending within a week.
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
varchar
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes

Last edited by Isabella_Smith; 05-13-2010 at 06:14 AM..
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
Old 05-13-2010, 07:21 AM Re: Am I using correct string to get the results ending within a week.
Novice Talker

Posts: 6
Name: lisa
Trades: 0
what is varchar?
dressupgames8 is offline
Reply With Quote
View Public Profile
 
Old 05-13-2010, 08:01 AM Re: Am I using correct string to get the results ending within a week.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Originally Posted by dressupgames8 View Post
what is varchar?
varchar is a variable length character field (strings)

the short answer is:
a sting stored in a 'char' field will be padded with spaces to the size of the field, whereas with a 'varchar' field it will be stored almost "as is" (minus any trailing spaces).

The long explanation is:
http://dev.mysql.com/doc/refman/5.0/en/char.html
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-13-2010, 08:03 AM Re: Am I using correct string to get the results ending within a week.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
AND This question is a perfect example of why dates should always be stored as date fields
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Am I using correct string to get the results ending within a week.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24547 seconds with 12 queries