Register and join over 40,000 other developers!
Recent Topics
-
Print specific values from dictionary with a specific key name
Siten0308 - Jun 20 2019 01:43 PM
-
Learn algorithms and programming concepts
johnnylo - Apr 23 2019 07:49 AM
-
Job Gig PHP Form Needed
PJohnson - Apr 18 2019 03:55 AM
-
How to make code run differently depending on the platform it is running on?
xarzu - Apr 05 2019 09:17 AM
-
How do I set a breakpoint in an attached process in visual studio
xarzu - Apr 04 2019 11:47 AM
Recent Blog Entries
Recent Status Updates
Popular Tags
- networking
- Managed C++
- stream
- console
- database
- authentication
- Visual Basic 4 / 5 / 6
- session
- Connection
- asp.net
- import
- syntax
- hardware
- html5
- array
- mysql
- java
- php
- c++
- string
- C#
- html
- loop
- timer
- jquery
- ajax
- javascript
- programming
- android
- css
- assembly
- c
- form
- vb.net
- xml
- linked list
- login
- encryption
- pseudocode
- calculator
- sql
- python
- setup
- help
- game
- combobox
- binary
- hello world
- grid
- innerHTML

7 replies to this topic
#1
Posted 19 April 2007 - 01:56 PM
Hi.
Slightly amateur question here (I'm new to SQL)
In Delphi, in using the ODBC, I'm trying to bring up a list of records that contain a 'date + time' attribute, that are smaller than the current date.
And is there anyway to bring up separate attributes such as 'first name' and 'surname' that correspond to the record being shown?
Sorry for such a basic question, I've just started learning SQL, and need it to complete my coursework.
Any help would be appreciated, thanks.
Slightly amateur question here (I'm new to SQL)
In Delphi, in using the ODBC, I'm trying to bring up a list of records that contain a 'date + time' attribute, that are smaller than the current date.
And is there anyway to bring up separate attributes such as 'first name' and 'surname' that correspond to the record being shown?
Sorry for such a basic question, I've just started learning SQL, and need it to complete my coursework.
Any help would be appreciated, thanks.
#2
Guest_Jordan_*
Posted 20 April 2007 - 05:44 AM
Hello,
Without knowing the table structure and the date/time format (is it Unix Timestamp?) it may look something like this:
If you give me the table structure and more info (like what SQL client you are using - MySQL, Access, msSQL, etc.) I can help you further.
Without knowing the table structure and the date/time format (is it Unix Timestamp?) it may look something like this:
SELECT tbl.firstname, tbl.surname FROM tbl AS tbl WHERE date < SYSDATE;
If you give me the table structure and more info (like what SQL client you are using - MySQL, Access, msSQL, etc.) I can help you further.
#3
Posted 20 April 2007 - 12:54 PM
Hi Jordan, thanks for the reply.Hello,
Without knowing the table structure and the date/time format (is it Unix Timestamp?) it may look something like this:SELECT tbl.firstname, tbl.surname FROM tbl AS tbl WHERE date < SYSDATE;
If you give me the table structure and more info (like what SQL client you are using - MySQL, Access, msSQL, etc.) I can help you further.
I'm using the ODBC feature in Delphi 5. I'm building the database into my software.
I built the database using Access, but exported it into a .DB format, a paradox database format if I can remember correctly.
At the moment I can successfully execute queries and return data. However, only to a degree.
This is basically what I want to do:
SELECT TimeDateIn, FirstName, Surname FROM orders.DB WHERE TimeDateIn < SYSDATE
I've managed to get the multiple fields working, because of the code you posted, thankyou for that. But I'm having some difficulty getting the 'SYSDATE' to work. It just comes up with 'Invalid Field Name', as if it doesn't recognise the line atall.
Once again, thankyou for your time.
#4
Posted 24 April 2007 - 05:46 AM
Anyone?
Sorry for bumping the thread but I need to hand this project in in a few weeks time and I'm getting really desperate about it now. All I need to do is get some SQL querys working.
I think I've figured out what date function Delphi 5 understands, CURRENT_DATE(). However it says that the compatability is not supported.
Thanks!
Sorry for bumping the thread but I need to hand this project in in a few weeks time and I'm getting really desperate about it now. All I need to do is get some SQL querys working.
I think I've figured out what date function Delphi 5 understands, CURRENT_DATE(). However it says that the compatability is not supported.
Thanks!
#5
Posted 24 April 2007 - 08:55 AM
A quick update,
I spoke to a fellow student today, and he has told me that it won't work by comparing the database attribute with an SQL function such as current_date().
Apparently, I have to set a variable inside the 'params'. And compare the variable with the database attribute.
The only problem is... The button to add a new param is greyed out. And I can't see anything obvious to change that.
Thanks.
I spoke to a fellow student today, and he has told me that it won't work by comparing the database attribute with an SQL function such as current_date().
Apparently, I have to set a variable inside the 'params'. And compare the variable with the database attribute.
The only problem is... The button to add a new param is greyed out. And I can't see anything obvious to change that.
Thanks.
#6
Guest_NeedHelp_*
Posted 26 April 2007 - 06:31 AM
So basically the SYSDATE cannot be used in a "Where"? Couldn't you do that in the SQL too?
SELECT variable, SYSDATE AS myDate .......... WHERE TimeDateIn < myDate;
#7
Posted 01 May 2007 - 09:31 AM
So basically the SYSDATE cannot be used in a "Where"? Couldn't you do that in the SQL too?
SELECT variable, SYSDATE AS myDate .......... WHERE TimeDateIn < myDate;
I agree, it should work in the SQL
If you look around some of the documentation on ODBC it may have another method listed...
#8
Posted 05 May 2007 - 10:54 AM
Unfortunately nothing came up, however it doesn't matter as I'm just going to write it in, the examiner isn't going to have a copy of the software itself. So he/she won't know it doesn't work.
Anyway, thanks the replies guys it is appreciated.
Anyway, thanks the replies guys it is appreciated.
Also tagged with one or more of these keywords: delphi, records
Language Forums →
Other Languages →
Pascal and Delphi →
TChart: resetting zoom without adjusting axis position?Started by AlecR, 07 Jan 2015 ![]() |
|
![]() |
||
Language Forums →
Other Languages →
Pascal and Delphi →
Zooming on button click using TChartStarted by AlecR, 25 Dec 2014 ![]() |
|
![]() |
||
Language Forums →
Other Languages →
Pascal and Delphi →
Validating user's input before creating TChart graphStarted by AlecR, 23 Dec 2014 ![]() |
|
![]() |
||
General Forums →
General Programming →
[Student - Project] Programming Website.Started by VelxioRH, 06 Oct 2014 ![]() |
|
![]() |
||
General Forums →
Everything Else →
Codecall Marketplace →
LaberinTux: A maze game with TuxStarted by luisvega, 17 May 2014 ![]() |
|
![]() |
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download