Topic: Big Question regarding the Database and Tables

Hi Guys,
I need your help.

I'm preparing two tables with personnel that at moment is working for my company and one table with the personnel are leave.

How I can make automatically this "shift" of records if one personnel leave my company?

How I can select one record with name , surname etc... and move  to leave table record. automatically and delete from actual personnel work?

Thanks for your help.

Cheers

Re: Big Question regarding the Database and Tables

Helo gabriele.distefano

First question :

Your two tables have  they the same structure, the same fields ?
this will facilitate the transfer of datas from one to the other

JB

Re: Big Question regarding the Database and Tables

Yes,
they have the same structure.
I want only put the date thtat the employee has left.

Re: Big Question regarding the Database and Tables

Hello Gabriele

Please find in attachment, a project I madeabout your question.
In the first form, I let them go : Jimmys Smith, Mel Gibson, Matt Damon and Jodi Foster.
really a bad manager !!!!!!

Tell me if this answers your question ?
I did not put the pictures because of the weight of the zip

JB

Post's attachments

Attachment icon Stefano.zip 334.82 kb, 410 downloads since 2015-10-11 

Re: Big Question regarding the Database and Tables

Oups Gabriele

In my project, I've forgotten the essential of your question : the left date

Please fin in this attachment, the correct project

JB

Post's attachments

Attachment icon Stefano2.zip 338.55 kb, 418 downloads since 2015-10-11 

Re: Big Question regarding the Database and Tables

Jean, many thanks

I try the database but when I put the left date and click on save appear only in actual employee and close the software automatically.
When I restart again the software doesn't appear in the filter all personnel left .

In the filter of left personnel is always blanck.

Thanks for your prompt reply
Cheers

Re: Big Question regarding the Database and Tables

Hello Gabriele

I use MVD version 1.53_v2
What's the version your are working with ?

The Form (Form1) should not be closed cause I've unchecked 'Close the current form after saving'

Do you want only ONE form which displays actual employees and left employees (with date),
By the way of a checkbox (or other way) you could see only left employees ?

What's happened when you click on label 'See table with left employees.
This one shows only left people with date of their departure.
I would have place a HandCursor to show there is a link.

To read you

JB

Re: Big Question regarding the Database and Tables

Hi JB
Me too i'm using the version 1.53

I try again but i didn 't see any match to the second form (Left employee)
I just download only your file Stefano2 and i don t install stefano.zip

Is also possible make with this software My visual database like accounting database for the personnel that take cash advance and/or buy something from our store and to be counted at end of the month the sum of money he took?

thanks
Giorgio

Re: Big Question regarding the Database and Tables

Hi Gabriele

Please install all files in the zip 'cause I've modified them.
But I think I've created a bug in the script. I looking for fix. (I've lost instruction to keep only records with a left date to transfer into second table).

Your last question : YES YOU CAN with calculated fields.

JB

Re: Big Question regarding the Database and Tables

gabriele.distefano
I don't recommend this method (using second table for leave persons).


You should create table for status of person.
Please look at second video tutorial (Phone book)
http://myvisualdatabase.com/video_lessons.html


where every person can belongs to group, in you case group will be status of person (Working, Fired, On vacation and so on...)

Dmitry.

Re: Big Question regarding the Database and Tables

Hello Gabriele, Hello Dmitry

Of course, it's clear
With a Status, it makes the job.
As I suppose Gabriele, wants to see only  active people on first display, she will have to parametrize this population in the groups.

Subsidiary question :
Why don't you recommend my previous approach ?

If I wanted to continue my intention,  what is the right syntax of my SQL query to transfer only those who left the company in the second table (with  date of departure). ?
I wrote this one but I was blocked by the date field :

SQLExecute('INSERT INTO Left_Employee (Last_Name,First_Name,Phone,Photo,comment,Left_Date) SELECT Last_Name,First_Name,Phone,Photo,comment,Left_Date FROM Employee WHERE Left_Date not NULL,'');

but it raises error about parity of ');

Thanks a lot Dimitry
Gabriele, good luck with you application

JB

Re: Big Question regarding the Database and Tables

No need to increase the entity, if it's a person, it should be store in one table, it does not matter, fired or not.
Otherwise in the future, this may complicates analysis of data.


about your query, try to add "IS"

SQLExecute('INSERT INTO Left_Employee (Last_Name,First_Name,Phone,Photo,comment,Left_Date) SELECT Last_Name,First_Name,Phone,Photo,comment,Left_Date FROM Employee WHERE Left_Date IS not NULL,'');
Dmitry.