Comparing Date-typed Variables

Comparing Date-typed Variables

Question:
How do I compare dates in VB? Also, how do I store dates into Access? I can’tget them into the right format.

Answer:
For comparison of dates, look up the documentation on the DateDiff function. There are several other similar functions for adding dates and getting pieces of the date. DateDiff is a very powerful and useful function.

As far as storing dates, Access is fairly forgiving about how dates look. If you are doing insert statements into the database, put the date into a Variant type before you do it as Access likes that better. You can use the CVar function to convert just about anything to a variant, but don’t use Variant variables as each one takes 64k of memory. Not good. If you set the format property on the masked edit box, you can get the date in the format you want fairly easily.

To format dates, use the Format function. The Format function allows you to format a date in virtually any format imaginable, including generic International dates.

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of