Roberto Spier

Greenhorn
+ Follow
since Sep 13, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Roberto Spier

Originally posted by John Gillespie:

String sql = "INSERT INTO LogEntry ( " +
"IPAddress, " +
"Date, " +

Any suggestions?
Thanks



Just a though, but Date is a reserved word in access that causes some wierd bugs. Try changing this field name.

hth,
Roberto

i think its an alternate Roberto.



Yes, but doing comparisons with database native types would'nt be faster than with such conversions?

BTW, how would this work with other dbms than SQL Server?
Hi,

Originally posted by Naadir Peterson:
but i need to select records of a certain date.. if i select only the date without the time it returns nothing...



to retrieve one date records through a dateTime column, you should use BETWEEN clause:

(Examples using ISO format)

SELECT *
FROM table
WHERE the_date between '2004-10-09T00:00:00' and '2004-10-09T23:59:59'; (using ISO format)

or just

WHERE the_date between '2004-10-09' and '2004-10-10'

This will return all records from 10/9/04 00:00:00 thru 10/9/04 23:59:59 or thru 10/10/10 00:00:00. Both will almost be fine.

bob
Hi, Matthew,

just a thought:

I think you'd not use a semi-colon IN the sql string.
Try



and also try using executeUpdate instead:


hth
Roberto
[ October 05, 2004: Message edited by: Roberto Spier ]
Hello, Keya,

I do it this way:


HTH
Roberto
Hello,

you haven't indicated what database you are using!

MySQL has a bitwise operator, and you'd do something like

SELECT * FROM table WHERE someBigIntField & 3;

hth
Roberto
Hi, Minh

your sql expression

String query = "Insert book Values(bc, bc, ba, baq)";

should pass the variable's values, not it's names. Thus, the parameters expected message.

Try something like

String query = "Insert book Values('" + bc + "', '" + bn + "', '" + ba + "', " + baq + ")";
System.out.println(query); // this should looks like your commented line below
//String query = "Insert into book Values ('AAA','BBB','CCC',1)";

hth (and my english makes sense)