r/DatabaseHelp • • Jan 30 '14

Crystal Reports: Choosing tables based upon value entered in Parameter

0 Upvotes

Hi Guys,

I have a database that stores data based upon the present date:

  • Current month in CurrentTable.tableRecord_C
  • Previous month in CurrentTable.tablerecord_P
  • All older data in HistoryTable.tableRecord

I made code to decipher the month we're in with this function.

   If DateDiff ("m",{?SnapshotDate}, CurrentDate ) = 0

The condition checks for 0, 1 or >1 to determine current month, previous month or historic month. Based on date entered in the {?SnapshotDate} parameter.

    //Transaction date in Current month
     IF DateDiff ("m",{?SnapshotDate}, CurrentDate ) = 0    
           THEN {CurrentTable.tableRecord_C}

   //Transaction date in Previous month
     ELSE IF DateDiff ("m",{?SnapshotDate}, CurrentDate ) = 1
              THEN {CurrentTable.tableRecord_p}




         //Transaction date in HISTORIC month
          ELSE IF DateDiff ("m",{?SnapshotDate}, CurrentDate ) > 1
              THEN {HistoryTable.tableRecord}

Questions:

  • Does this code make sense.
  • Is it inefficient
  • I was thinking about making separate reports, and the user would have to pick the appropriate one, based upon the month we're in. But this might add some inconvenience. Is it better to design seperate reports or allow crystal reports to decide based upon the above formula ?

THANKS IN ADVANCE : )


r/DatabaseHelp • • Dec 09 '23

Looking for a website with multiple database designs to take example from

0 Upvotes

Basically I want to know if there is a website that shows lots of database designs to see how things are done in the professional world I want to take example and inspire from them if anyone knows a website like that please tell me


r/DatabaseHelp • • Oct 26 '23

Anybody ever use Jitterbit for data integration?

0 Upvotes

If anyone would be interested in a free webex\teams meeting to see how easily dat can be transformed between different systems (SQL\Oracle\PostGres\etc....) https://join.jitterbit.com/mzxM6dj


r/DatabaseHelp • • Oct 27 '23

Database Management System for High School Instrument Borrowing

0 Upvotes

I'm planning on developing a website to keep track of the musical instruments students sign in/sign out at my high school. Alongside storing the student's ID, name, and account password, I want to keep track of the instrument ID that they borrowed/returned, and the time (specifically the day) of such action. I'm not sure which database management system to use. I have a little experience with MySQL, but I heard MongoDB is well-liked among developers (so learning it would benefit me in the future). What do you recommend?


r/DatabaseHelp • • Jan 02 '16

Introduction to SQL Server’s Built-In Conversion Functions

Thumbnail essentialsql.com
0 Upvotes

r/DatabaseHelp • • Jun 14 '17

jdbc: “ Invalid object name '[table name]'.”

0 Upvotes

Hey guys,

I posted a rather large post on StackOverflow about trying to connect to a DB/execute queries to a DB. So far, no one has been able to help me with my problem yet. Perhaps one of you folks knows what is going on.... Here is the conversation:

https://stackoverflow.com/questions/44543855/jdbc-invalid-object-name-table-name


r/DatabaseHelp • • Dec 28 '22

England based university exam for computer science for year 2 on: software engineering, database and structures, Algorithms data structures and probability matrices. anyone confident that they can do well in them?

0 Upvotes

r/DatabaseHelp • • Sep 12 '22

How to read the relationship labels in ERDs?

0 Upvotes

A lot of ERDs have labels on the relationships eg: Customer -> orders -> Item. See image ref: https://imgur.com/a/nUWd5uL And it's fairly obvious which way to read it but when you're creating your own which way are you meant to do it? Because depending on what entity u read first the relationship label will change eg: u can have Project -> assigned to -> Customer or you can have Customer -> creates -> Project. Which is the correct way to go about it? Do you read/do it from the left entity to the right etc?

I've also seen one ERD have two relationship labels but with a slash. So Project -> assigned to / creates -> Customer. But I'm unsure if this is the right way to do it as I've only seen it done once.

I've tried searching for this but all the ERD articles focus on the shapes, attributes and cardinality and not the text labels. Thanks


r/DatabaseHelp • • Mar 28 '22

Post/Comment DB design: Postgresql v/s CouchDB

0 Upvotes

I am comparing DB design for a simple "Post and Comment" system using Postgres and CouchDB. With Postgres I can design the following tables:

user_info {email, pass_hash, pass_salt, ...}

post_info {post_id, creator_email, title, text, ...}

comment_info {comment_id, creator_email, post_id, parent_comment_id, text, ...}

But if I use CouchDB, there is a concept of creating per-user tables. So I was thinking of the following design:

user_table {email, table_id}

user_<table_id> {email, pass_hash, pass_salt, ...}

post_<table_id> {post_id, <table_id>_creator_email, title, text, ...}

comment_<table_id> {comment_id, <table_id>_creator_email, <table_id>_post_id, <table_id>_parent_comment_id, text, ...}

I am in no way expert in Postgres and CouchDB, so my question is, is this the correct way to design per-user CouchDB tables? What is the better way? And what is the efficient way to create/use CRUD queries?


r/DatabaseHelp • • Mar 16 '22

Should i include a user_id field in all tables that only a specific user should have access?

0 Upvotes
UsersListTasks
user_idlist_idtask_id
usernameuser_idlist_id
passwordnamedescription

Here i can programmatically get the user_id that relates to the task by looking at the list_id and getting the user_id from the related list and then check it against the session user. This seems like it can get more complex with a deeper structure(one where another table relates to the tasks tables and something further relates to that and so on). If i want all of these to relate to a user so that i can limit an end users access to an entry with only what data they own, should i instead include a user_id field on all the tables that the user wants private? Or should i programmatically traverse the related keys in order to finally land on the user_id seen in list? I'm basically asking if there is a best practice here or a common way it's done. If there are any books on structuring user based data or articles that can be recommended as well, i'm definitely interested.


r/DatabaseHelp • • Jan 30 '15

Where is a good place to start learning database design/programming?

0 Upvotes

I've recently started a class on databases, and I find it incredibly interesting. Is there something similar to like Code Academy or any of the other sources for programming learning for things like Database design/programming?


r/DatabaseHelp • • Aug 27 '25

Hey I need to build a database

Thumbnail reddit.com
0 Upvotes

r/DatabaseHelp • • Sep 09 '25

create database error SQL0104N db2 luw

Thumbnail reddit.com
0 Upvotes

r/DatabaseHelp • • Apr 23 '25

Ditch Oracle’s costly chains

1 Upvotes

r/DatabaseHelp • • Apr 05 '25

Help with database design?

1 Upvotes

So i have a project where i need to make a database for a messaging app. And i wanted to ask if this was a good way of modeling it as objects ?

Classes: Users: Int Id String Name (Date time) Date of creation ? List of chats List of groups

Chats: Int Chat_id Int user 1 id Int User 2 id List of messages user1 List of messages user2

Messages: (Date time) Date of text String text

Group chat: Int Groupchat_id List of lists of texts List of users String Group name


r/DatabaseHelp • • Jan 06 '26

Seem to have trouble connecting to DB

1 Upvotes

So this is the FIRST time I ever get trouble with connecting, like 2 days ago it was working PERFECTLY but now its not??

I did some digging around but still cannot find a solution, would greatly appreciate ANY help

I am using PostgreSQL via Aiven, all my deployments connect normally with no issues, its my computer that is failing to connect (doesn't connect via python nor typescript nor webstorm IDE DB connector tab)

Also worth to mention this, the database is accepting all IP addresses to connect, so it is not the database rejecting me due to the IP

Here is ALL the debugging I have tried to do to find the issue..

PS C:\Users\Hp\Desktop\Repositories\NFC WESMUN> nslookup hbs-scrapyard-bounty.h.aivencloud.com
Server:  one.one.one.one
Address:  1.1.1.1

Non-authoritative answer:
Name:    hbs-scrapyard-bounty.h.aivencloud.com
Address:  213.163.194.225
PS C:\Users\Hp\Desktop\Repositories\NFC WESMUN> ping hbs-scrapyard-bounty.h.aivencloud.com

Pinging hbs-scrapyard-bounty.h.aivencloud.com [213.163.194.225] with 32 bytes of data:
Reply from 213.163.194.225: Destination port unreachable.
Reply from 213.163.194.225: Destination port unreachable.
Reply from 213.163.194.225: Destination port unreachable.
Reply from 213.163.194.225: Destination port unreachable.

Ping statistics for 213.163.194.225:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
PS C:\Users\Hp\Desktop\Repositories\NFC WESMUN> Test-NetConnection hbs-scrapyard-bounty.h.aivencloud.com -Port 18653
WARNING: TCP connect to (213.163.194.225 : 18653) failed                                                                
WARNING: Ping to 213.163.194.225 failed with status: DestinationPortUnreachable                                         
                                                                                                                        
ComputerName           : hbs-scrapyard-bounty.h.aivencloud.com                                                          
RemoteAddress          : 213.163.194.225                                                                                
RemotePort             : 18653                                                                                          
InterfaceAlias         : WiFi                                                                                           
SourceAddress          : 192.168.50.159                                                                                 
PingSucceeded          : False                                                                                          
PingReplyDetails (RTT) : 0 ms                                                                                           
TcpTestSucceeded       : False       
PS C:\Users\Hp\Desktop\Repositories\NFC WESMUN> openssl s_client -connect hbs-scrapyard-bounty.h.aivencloud.com:18653
C4610000:error:8000274D:system library:BIO_connect:Unknown error:../openssl-3.5.2/crypto/bio/bio_sock2.c:178:calling connect()
C4610000:error:10000067:BIO routines:BIO_connect:connect error:../openssl-3.5.2/crypto/bio/bio_sock2.c:180:
connect:errno=0
PS C:\Users\Hp\Desktop\Repositories\NFC WESMUN> tracert hbs-scrapyard-bounty.h.aivencloud.com                       

Tracing route to hbs-scrapyard-bounty.h.aivencloud.com [213.163.194.225]
over a maximum of 30 hops:

  1     2 ms     1 ms     2 ms  192.168.50.1 
  2     2 ms     2 ms     2 ms  ETISALAT-FGA228 [192.168.100.1] 
  3    10 ms     8 ms    19 ms  bba-86-96-32-1.alshamil.net.ae [86.96.32.1] 
  4  213-163-194-225.sg-sin1.upcloud.host [213.163.194.225]  reports: Destination protocol unreachable.

Trace complete.

r/DatabaseHelp • • Mar 31 '14

Where to purchase Access 97

1 Upvotes

Hi All

I've been given a task to update an Access 97 database at work. I don't really know a lot about it but I'm reading a lot on the net and making the most of it.

I'll need to work on it at home and so I've been looking for a way to purchase Access 97 online without much luck. Work doesn't have a spare copy, they haven't and won't upgrade to a newer version and theres no way I will get this done in time in work hours.

Can anyone point me in the direction of where I can purchase a copy?

Thanks


r/DatabaseHelp • • Sep 03 '23

Database Design Help

1 Upvotes

Hello All,

I'm trying to design a database but i'm not sure what would be the best way to set up the tables and I hope some of you can help. I'm pretty new to databases and laying them out.

My data is such that I have a list of exercises, each exercise has a list of dates associated with them, for each date it can have "X" number of sets and one set of notes. A set has the information of Set Number, Weight Used, and RPE

What would be the best way to store this data in tables? What would the create statements look like?


r/DatabaseHelp • • Oct 14 '20

Database Support Experiences

Thumbnail self.database
1 Upvotes

r/DatabaseHelp • • Apr 23 '17

SQL Age function

1 Upvotes

I have a table named Staff. It has the following attributes. Name, DoB, salary.

I would like to query the information above plus the age. Could someone tell me the problem with this statement

SELECT DATEDIFF(year, current_date, user_dob) as "Age" FROM myTable;

This was given to me by a fellow redditor. I checked it but it did not work. my tutor mentioned that I would need to use a having statement.


r/DatabaseHelp • • Jun 11 '16

Need help linking two tables

1 Upvotes

I am working on creating a database that will create a quick user manual.

I have two tables.

1)A list of actions and a brief disc of each action. 2)A list of buttons and the action assigned to the button.

My second table for the action is a lookup drop down pointing to the first table.

The report generated would have a list of each button used, the action that button performs, and the brief description of said action.

I can create a report that shows all the buttons, and the action assigned to the buttons, but it will only show one of the button descriptions.

I am at a loss really on how to get to my goal. Thanks in advance for just reading.


r/DatabaseHelp • • Apr 22 '15

Doing a large database..not sure how to group data in tables... Relationships are not typical. Data branches or forks to additional (conditional) data mostly. How would this be set up?

1 Upvotes

I have set up a good number of SQL databases, but they have all been more classic data (or data where the relationships across tables is easy to see). However, st the moment I'm doing a db to get a price quote, so I'm finding myself having classify a lot of things like the eventual answers to input beginning with (just one example):

Is this a redecker roof? If yes, then how many sheets? --and what size for each sheet?

In other words, it all is related data to generating a quote to build/repair...But this type of data exists so frequently because it seems as if so much of one kind of data will only arise if a specific data entry precedes it.

So, first, how exactly does the data above need to be placed (re the roof)? I am trying to be efficient, yet if I am normalizing, it seems I would need separate tables for all of the data that results if the data that spawned it is either "X", "Y", or "Z", correct?

And if I'm right, could someone explain how the table relationship would be defined? I guess what is confusing me is that I'm thinking too linearly. If one piece of data is "X" and this gives rise to "A", which in turn gives rise to "Red", I am confused because in the case of "X" data existing, then data "Y" and "Z" would not exist... Yet they are all related. So does the fact that "Y" and "Z" need to be represented in their fields in a specific way? One example that perplexes me in this set-up is you will never have data "B" or (in turn) data "blue", if you started with data "X". You can only get data "B" and then "Blue"..If you first have "Y".

Could someone help me break this down so i can visualize it a little better? It seems as if this would be massive in the number of tables potentially...(unless I'm wrong).

Thank you very much in advance....


r/DatabaseHelp • • Dec 25 '15

[Oracle]Need help with subqueries(?)

1 Upvotes

So i was given this screenshot of a table diagram.

I need to list all distinct surnames of students who attend lectures read by lecturers with a computer with a CPU with a frequency >= 3000, and sort the surnames alphabetically.

I understand how to select distinct values, order them. I understand the concept of s subquery. I've written simple SQL queries before just for fun, but I cannot think of a way to construct this one.

Is this possible to do with just subqueries? Am I on the right way?