Need a database app - Ubuntu
This is a discussion on Need a database app - Ubuntu ; Okay, here's what I need to do: I need to design a database where I can
store dates, then add, say, 30 days to a date, and have the result be 30
days from that date. I also need to ...
-
Need a database app
Okay, here's what I need to do: I need to design a database where I can
store dates, then add, say, 30 days to a date, and have the result be 30
days from that date. I also need to subtract one date from another and
get the number of days between dates.
I've looked at Kexi and can't see how to do this -- I don't think it has
that kind of sophistication.
Any ideas? I'm using Ubuntu 8.04. Thanks.
-
Re: Need a database app
In article , Jeffrey Needle wrote:
>Okay, here's what I need to do: I need to design a database where I can
>store dates, then add, say, 30 days to a date, and have the result be 30
>days from that date. I also need to subtract one date from another and
>get the number of days between dates.
>
>I've looked at Kexi and can't see how to do this -- I don't think it has
>that kind of sophistication.
>
>Any ideas? I'm using Ubuntu 8.04. Thanks.
I'd think any SQL database would do that for you. Postgres SQL does what you
want, though data math can be squirrely with any product. Postgres may be
overkill.
Eric
-
Re: Need a database app
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
EricF wrote:
> In article , Jeffrey Needle wrote:
>> Okay, here's what I need to do: I need to design a database where I can
>> store dates, then add, say, 30 days to a date, and have the result be 30
>> days from that date. I also need to subtract one date from another and
>> get the number of days between dates.
>>
>> I've looked at Kexi and can't see how to do this -- I don't think it has
>> that kind of sophistication.
>>
>> Any ideas? I'm using Ubuntu 8.04. Thanks.
> I'd think any SQL database would do that for you. Postgres SQL does what you
> want, though data math can be squirrely with any product. Postgres may be
> overkill.
>
> Eric
SQL Databases would be the best. Install mysqld and then Apache and set
up something called PHPMyAdmin to manage it.
- --
________
David M Lemcoe Jr.
ender@ender.ath.cx
Roswell, Georgia
Running Ubuntu 8.10 the "Intrepid Ibex"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkkO6p8ACgkQo7q5Tz2TZsG6SACfSnbtqH8PHA KtBmTU1NNRSRFn
o6oAoIBQMhYpED4KrlaBxvN2jrTk6R36
=xjYK
-----END PGP SIGNATURE-----
-
Re: Need a database app
David Marshall Lemcoe Jr. wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> EricF wrote:
>> In article , Jeffrey Needle wrote:
>>> Okay, here's what I need to do: I need to design a database where I can
>>> store dates, then add, say, 30 days to a date, and have the result be 30
>>> days from that date. I also need to subtract one date from another and
>>> get the number of days between dates.
>>>
>>> I've looked at Kexi and can't see how to do this -- I don't think it has
>>> that kind of sophistication.
>>>
>>> Any ideas? I'm using Ubuntu 8.04. Thanks.
>> I'd think any SQL database would do that for you. Postgres SQL does what you
>> want, though data math can be squirrely with any product. Postgres may be
>> overkill.
>>
>> Eric
> SQL Databases would be the best. Install mysqld and then Apache and set
> up something called PHPMyAdmin to manage it.
>
Thanks to both responders -- I'll follow up on the suggestions.
-
Re: Need a database app
On Mon, 03 Nov 2008 01:58:43 +0000, Jeffrey Needle wrote:
> Okay, here's what I need to do: I need to design a database where I can
> store dates, then add, say, 30 days to a date, and have the result be 30
> days from that date. I also need to subtract one date from another and
> get the number of days between dates.
>
> I've looked at Kexi and can't see how to do this -- I don't think it has
> that kind of sophistication.
>
> Any ideas? I'm using Ubuntu 8.04. Thanks.
Sounds like a simple spreadsheet problem to me. Where does the database
part come in?
--
Stephan
1986 Pontiac Fiero GT
君の事思い出す日なんてないのは
君の事忘れたときがないから
-
Re: Need a database app
Jeffrey Needle wrote:
>
> Okay, here's what I need to do: I need to design a database where
> I can store dates, then add, say, 30 days to a date, and have the
> result be 30 days from that date. I also need to subtract one
> date from another and get the number of days between dates.
>
> I've looked at Kexi and can't see how to do this -- I don't think
> it has that kind of sophistication.
>
> Any ideas? I'm using Ubuntu 8.04. Thanks.
The system doesn't matter. What you need is a representation of
dates as an integer past a base date, in days. That means
designing a way to transform normal dates to/from that format.
Don't forget leap years and non-leap years (such as 1900 or 2100).
--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]:
Try the download section.
-
Re: Need a database app
On Mon, 03 Nov 2008 18:46:50 -0500, CBFalconer wrote:
> Jeffrey Needle wrote:
>> Okay, here's what I need to do: I need to design a database where I can
>> store dates, then add, say, 30 days to a date, and have the result be
>> 30 days from that date. I also need to subtract one date from another
>> and get the number of days between dates.
>
> The system doesn't matter. What you need is a representation of dates
> as an integer past a base date, in days. That means designing a way to
> transform normal dates to/from that format. Don't forget leap years and
> non-leap years (such as 1900 or 2100).
You may want to check out http://www.askdavetaylor.com/
date_math_in_linux_shell_script.html
You may also want to simply use the date command with the --date option:
date --date='+30 days'
Also it accepts '+3 weeks', yesterday, tomorrow, 'last thursday', '+5
months +3 days', '10 years ago', etc.
Also 'date +%s' gives the epoch (seconds since 1970-01-01 00:00:00 UTC).
Take the difference between two epochs, divide as needed to get the time
difference. Gnu 'date' takes care of all the leapyear stuff. I saw this
in Linux Journal March 2008 pg.10, Letters to the Editor.
-
Re: Need a database app
On Mon, 03 Nov 2008 01:58:43 +0000, Jeffrey Needle wrote:
> Okay, here's what I need to do: I need to design a database where I can
> store dates, then add, say, 30 days to a date, and have the result be 30
> days from that date. I also need to subtract one date from another and
> get the number of days between dates.
Install the SQL Lite Manager into Firefox (it's an extension), create a
simple database for testing.
Here is the SQL for a test table I just created for you:
(I used the SQL Lite Manager Export Database feature)
DROP TABLE IF EXISTS "mydates_tbl";
CREATE TABLE "mydates_tbl" ("int" INTEGER PRIMARY KEY AUTOINCREMENT
NOT NULL , "adate" DATETIME DEFAULT CURRENT_DATE);
INSERT INTO "mydates_tbl" VALUES(1,2038);
DROP TABLE IF EXISTS "sqlite_sequence";
CREATE TABLE sqlite_sequence(name,seq);
INSERT INTO "sqlite_sequence" VALUES('mydates_tbl',1);
To get you started here is how to enter one row of aged data by 30 days:
insert into mydates_tbl (adate) values (current_date + 30)
To find that record:
SELECT * FROM mydates_tbl where adate > current_date + 29
--
// This is my opinion.
-
Re: Need a database app
Stephan Rose wrote:
> On Mon, 03 Nov 2008 01:58:43 +0000, Jeffrey Needle wrote:
>
>> Okay, here's what I need to do: I need to design a database where I can
>> store dates, then add, say, 30 days to a date, and have the result be 30
>> days from that date. I also need to subtract one date from another and
>> get the number of days between dates.
>>
>> I've looked at Kexi and can't see how to do this -- I don't think it has
>> that kind of sophistication.
>>
>> Any ideas? I'm using Ubuntu 8.04. Thanks.
>
> Sounds like a simple spreadsheet problem to me. Where does the database
> part come in?
>
I'm more comfortable with a database environment. And I need to design
reports that are easier in a database environment.
-
Re: Need a database app
Roland Latour wrote:
> On Mon, 03 Nov 2008 18:46:50 -0500, CBFalconer wrote:
>
>> Jeffrey Needle wrote:
>>> Okay, here's what I need to do: I need to design a database where I can
>>> store dates, then add, say, 30 days to a date, and have the result be
>>> 30 days from that date. I also need to subtract one date from another
>>> and get the number of days between dates.
>> The system doesn't matter. What you need is a representation of dates
>> as an integer past a base date, in days. That means designing a way to
>> transform normal dates to/from that format. Don't forget leap years and
>> non-leap years (such as 1900 or 2100).
>
> You may want to check out http://www.askdavetaylor.com/
> date_math_in_linux_shell_script.html
>
> You may also want to simply use the date command with the --date option:
> date --date='+30 days'
> Also it accepts '+3 weeks', yesterday, tomorrow, 'last thursday', '+5
> months +3 days', '10 years ago', etc.
>
> Also 'date +%s' gives the epoch (seconds since 1970-01-01 00:00:00 UTC).
> Take the difference between two epochs, divide as needed to get the time
> difference. Gnu 'date' takes care of all the leapyear stuff. I saw this
> in Linux Journal March 2008 pg.10, Letters to the Editor.
Thanks for the leads!
-
Re: Need a database app
jebblue wrote:
> On Mon, 03 Nov 2008 01:58:43 +0000, Jeffrey Needle wrote:
>
>> Okay, here's what I need to do: I need to design a database where I can
>> store dates, then add, say, 30 days to a date, and have the result be 30
>> days from that date. I also need to subtract one date from another and
>> get the number of days between dates.
>
> Install the SQL Lite Manager into Firefox (it's an extension), create a
> simple database for testing.
>
> Here is the SQL for a test table I just created for you:
> (I used the SQL Lite Manager Export Database feature)
>
> DROP TABLE IF EXISTS "mydates_tbl";
> CREATE TABLE "mydates_tbl" ("int" INTEGER PRIMARY KEY AUTOINCREMENT
> NOT NULL , "adate" DATETIME DEFAULT CURRENT_DATE);
> INSERT INTO "mydates_tbl" VALUES(1,2038);
> DROP TABLE IF EXISTS "sqlite_sequence";
> CREATE TABLE sqlite_sequence(name,seq);
> INSERT INTO "sqlite_sequence" VALUES('mydates_tbl',1);
>
> To get you started here is how to enter one row of aged data by 30 days:
>
> insert into mydates_tbl (adate) values (current_date + 30)
>
> To find that record:
>
> SELECT * FROM mydates_tbl where adate > current_date + 29
>
Thanks! This looks like a good lead!