Author |
Message |
Joseph Ranset #1 / 13
|
 SELECT Statement returns no records....
Okay very simple.....I have the following SELECT statement in an asp page, but it returns no records. The records ARE in the database, and they are of the format dd/mm/yy (just like the sql) Is there something I'm overlooking? SQL: " SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE = #11/07/00# " TIA! Joseph
|
Sat, 28 Dec 2002 03:00:00 GMT |
|
 |
Joseph Ranset #2 / 13
|
 SELECT Statement returns no records....
I forgot to specify....I'm using Access 2000. They are stored as dd/mm/yy.
Quote: > Dates in SQL server are normally stored in datetime format > try .... and convert(varchar(10),date,101) = "11/07/2000" > that chops off the time part.... > Russ
> > Okay very simple.....I have the following SELECT statement in an asp page, > > but it returns no records. The records ARE in the database, and they are > of > > the format dd/mm/yy (just like the sql) Is there something I'm > overlooking? > > SQL: > > " SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE = #11/07/00# > " > > TIA! > > Joseph
|
Sat, 28 Dec 2002 03:00:00 GMT |
|
 |
Joseph Ranset #3 / 13
|
 SELECT Statement returns no records....
Yes, I tried.....no luck. Sorry.
Quote: > Joseph, > Did you do what I suggested and reverse the date data in your variable? > To: SQL: = "SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE => > #7/11/00# > And if so did this return the recordset that you were hoping to see in the > first place? > I'm just curious because I spent about 3 hours last night on exactly this > problem. > Thanks, > lagerBoy
> > I forgot to specify....I'm using Access 2000. > > They are stored as dd/mm/yy.
> > > Dates in SQL server are normally stored in datetime format > > > try .... and convert(varchar(10),date,101) = "11/07/2000" > > > that chops off the time part.... > > > Russ
> > > > Okay very simple.....I have the following SELECT statement in an asp > > page, > > > > but it returns no records. The records ARE in the database, and they > > are > > > of > > > > the format dd/mm/yy (just like the sql) Is there something I'm > > > overlooking? > > > > SQL: > > > > " SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE = > > #11/07/00# > > > " > > > > TIA! > > > > Joseph
|
Sat, 28 Dec 2002 03:00:00 GMT |
|
 |
lagerBo #4 / 13
|
 SELECT Statement returns no records....
Does it return any records if you change the sqlString to: sql= "SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE = #07/11/00#" Just wondering because I had some date difficulty (and not because I ate too much curry!) last night.
Quote: > Okay very simple.....I have the following SELECT statement in an asp page, > but it returns no records. The records ARE in the database, and they are of > the format dd/mm/yy (just like the sql) Is there something I'm overlooking? > SQL: > " SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE = #11/07/00# " > TIA! > Joseph
|
Sun, 29 Dec 2002 03:00:00 GMT |
|
 |
Russ Marzol #5 / 13
|
 SELECT Statement returns no records....
Dates in SQL server are normally stored in datetime format try .... and convert(varchar(10),date,101) = "11/07/2000" that chops off the time part.... Russ
Quote: > Okay very simple.....I have the following SELECT statement in an asp page, > but it returns no records. The records ARE in the database, and they are of > the format dd/mm/yy (just like the sql) Is there something I'm overlooking? > SQL: > " SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE = #11/07/00# " > TIA! > Joseph
|
Sun, 29 Dec 2002 03:00:00 GMT |
|
 |
lagerBo #6 / 13
|
 SELECT Statement returns no records....
Joseph, Did you do what I suggested and reverse the date data in your variable? To: SQL: = "SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE => #7/11/00# And if so did this return the recordset that you were hoping to see in the first place? I'm just curious because I spent about 3 hours last night on exactly this problem. Thanks, lagerBoy
Quote: > I forgot to specify....I'm using Access 2000. > They are stored as dd/mm/yy.
> > Dates in SQL server are normally stored in datetime format > > try .... and convert(varchar(10),date,101) = "11/07/2000" > > that chops off the time part.... > > Russ
> > > Okay very simple.....I have the following SELECT statement in an asp > page, > > > but it returns no records. The records ARE in the database, and they > are > > of > > > the format dd/mm/yy (just like the sql) Is there something I'm > > overlooking? > > > SQL: > > > " SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE = > #11/07/00# > > " > > > TIA! > > > Joseph
|
Sun, 29 Dec 2002 03:00:00 GMT |
|
 |
pedr #7 / 13
|
 SELECT Statement returns no records....
perhaps the date format depends on the server have you tried mm/dd/yyyy in your query just to see if i'm wrong
Quote: > Okay very simple.....I have the following SELECT statement in an asp page, > but it returns no records. The records ARE in the database, and they are of > the format dd/mm/yy (just like the sql) Is there something I'm overlooking? > SQL: > " SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE = #11/07/00# " > TIA! > Joseph
|
Sun, 29 Dec 2002 03:00:00 GMT |
|
 |
Pierre Laure #8 / 13
|
 SELECT Statement returns no records....
try to put quotes over the date, like '#01/01/00#'
Quote: > Yes, I tried.....no luck. Sorry.
> > Joseph, > > Did you do what I suggested and reverse the date data in your variable? > > To: SQL: = "SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE => > > #7/11/00# > > And if so did this return the recordset that you were hoping to see in the > > first place? > > I'm just curious because I spent about 3 hours last night on exactly this > > problem. > > Thanks, > > lagerBoy
> > > I forgot to specify....I'm using Access 2000. > > > They are stored as dd/mm/yy.
> > > > Dates in SQL server are normally stored in datetime format > > > > try .... and convert(varchar(10),date,101) = "11/07/2000" > > > > that chops off the time part.... > > > > Russ
> > > > > Okay very simple.....I have the following SELECT statement in an asp > > > page, > > > > > but it returns no records. The records ARE in the database, and > they > > > are > > > > of > > > > > the format dd/mm/yy (just like the sql) Is there something I'm > > > > overlooking? > > > > > SQL: > > > > > " SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE = > > > #11/07/00# > > > > " > > > > > TIA! > > > > > Joseph
|
Sun, 29 Dec 2002 03:00:00 GMT |
|
 |
Mark Schup #9 / 13
|
 SELECT Statement returns no records....
look at the dates in the database. If they have a time other than 00:00:00 you will not match them with the = operator. Try between. -- Mark Schupp -- Head of Development Integrity eLearning Online Learning Solutions Provider Authorized Macromedia Training Center
http://www.ielearning.com 714.637.9480 x17
Quote: > I forgot to specify....I'm using Access 2000. > They are stored as dd/mm/yy.
> > Dates in SQL server are normally stored in datetime format > > try .... and convert(varchar(10),date,101) = "11/07/2000" > > that chops off the time part.... > > Russ
> > > Okay very simple.....I have the following SELECT statement in an asp > page, > > > but it returns no records. The records ARE in the database, and they > are > > of > > > the format dd/mm/yy (just like the sql) Is there something I'm > > overlooking? > > > SQL: > > > " SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE = > #11/07/00# > > " > > > TIA! > > > Joseph
|
Sun, 29 Dec 2002 03:00:00 GMT |
|
 |
mAd hAcke #10 / 13
|
 SELECT Statement returns no records....
The dates are stored without any time values.....just dd/mm/yy. The values are being entered via a form, with a dropdown box to select the day, month, and year. There is no time associated whatsoever --
Quote: > look at the dates in the database. If they have a time other than 00:00:00 > you will not match them with the = operator. Try between. > -- > Mark Schupp > -- > Head of Development > Integrity eLearning > Online Learning Solutions Provider > Authorized Macromedia Training Center
> http://www.ielearning.com > 714.637.9480 x17
> > I forgot to specify....I'm using Access 2000. > > They are stored as dd/mm/yy.
> > > Dates in SQL server are normally stored in datetime format > > > try .... and convert(varchar(10),date,101) = "11/07/2000" > > > that chops off the time part.... > > > Russ
> > > > Okay very simple.....I have the following SELECT statement in an asp > > page, > > > > but it returns no records. The records ARE in the database, and they > > are > > > of > > > > the format dd/mm/yy (just like the sql) Is there something I'm > > > overlooking? > > > > SQL: > > > > " SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE = > > #11/07/00# > > > " > > > > TIA! > > > > Joseph
|
Sun, 29 Dec 2002 03:00:00 GMT |
|
 |
Brandon Shult #11 / 13
|
 SELECT Statement returns no records....
Every body writes the satements a little different. here is how I would write it: SELECT * FROM POWER_USAGE WHERE (ID="gm") AND (DATE=#11/7/2000#);
Quote: > try this > SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE = #11-07-00# "
> > Okay very simple.....I have the following SELECT statement in an asp page, > > but it returns no records. The records ARE in the database, and they are > of > > the format dd/mm/yy (just like the sql) Is there something I'm > overlooking? > > SQL: > > " SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE = #11/07/00# > " > > TIA! > > Joseph
|
Thu, 23 Jan 2003 03:00:00 GMT |
|
 |
Brandon Shult #12 / 13
|
 SELECT Statement returns no records....
Everybody writes them a little different, but here is how I would write it: SELECT * FROM POWER_USAGE WHERE (ID='gm') AND (DATE=#11/7/2000#)
Quote: > try this > SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE = #11-07-00# "
> > Okay very simple.....I have the following SELECT statement in an asp page, > > but it returns no records. The records ARE in the database, and they are > of > > the format dd/mm/yy (just like the sql) Is there something I'm > overlooking? > > SQL: > > " SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE = #11/07/00# > " > > TIA! > > Joseph
|
Thu, 23 Jan 2003 03:00:00 GMT |
|
 |
JOn #13 / 13
|
 SELECT Statement returns no records....
When troubleshooting always eleminate all possible errors. Your code should work so try: Select * from POWER_USAGE where CLIENT_ID = 'GM' If you get records then your real problem is probably the use of the work DATE in your statement. Change that field to something else like DTM -- for Date TiMe and the try the query SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE = #11/07/00# Using reserved words is the hardest thing to not do. I would suspect that is where the real problem lies. Jon Boss
Quote: > Okay very simple.....I have the following SELECT statement in an asp page, > but it returns no records. The records ARE in the database, and they are of > the format dd/mm/yy (just like the sql) Is there something I'm overlooking? > SQL: > " SELECT * FROM POWER_USAGE WHERE CLIENT_ID = 'GM' AND DATE = #11/07/00# " > TIA! > Joseph
|
Fri, 24 Jan 2003 03:00:00 GMT |
|
|