Static and dynamic moduli of a sandstone may be different and stress-sensitive. Knowledge about this is important for the interpretation of seismic data and sonic logs. We use a numerical model which is based on the discrete element method (DEM) to study the static and the dynamic mechanical behavior of weak sandstones. We developed a constitutive contact law and implemented it into the DEM model in order to properly simulate the deformation of weak sandstones. The contact law includes the effect of nonlinear elasticity and plasticity at grain contacts. The DEM model can also capture the effect of the closing of pre-existing cracks, the formation of new cracks and slip at uncemented grain contacts due to stress alteration. Using such a model, we simulated sandstone specimens under laboratory experimental conditions. We calculated the static and the dynamic moduli of the DEM model at different stress states. The modeling results qualitatively agree with some published laboratory observations. By applying different stress paths and stress histories, we studied how the moduli were influenced by the stress state, stress path, and stress history. In particular, the simulations show the growing difference between the static and the dynamic moduli as failure is approached. The simulations thus support the assumption that theoretical insight in the grain-scale deformation mechanisms helps to understand and explain the difference between static and dynamic moduli, as well as for the failure process.